Contract 0x44e9c30956735b3fba25278d3c610ce2b6594fdb

Contract Overview

Balance:
0 MATIC
Txn Hash
Method
Block
From
To
Value [Txn Fee]
0xd03be17d1156bf8f8b191778dd422f493e4b1c1c35fb8bcd05900b91c5603a91Set Interval328458212023-03-08 5:04:2785 days 14 hrs ago0xcfefd28d3024baaa180a61e6a505f0c9bb5a9e24 IN  0x44e9c30956735b3fba25278d3c610ce2b6594fdb0 MATIC0.000026613 1.000000016
0x0ada35f78a140b5a0139a3ca3999022b194ceb2442011b6e93add6378782134cSet Interval328456802023-03-08 4:59:2985 days 14 hrs ago0xcfefd28d3024baaa180a61e6a505f0c9bb5a9e24 IN  0x44e9c30956735b3fba25278d3c610ce2b6594fdb0 MATIC0.000026625 1.000000016
0x58131534fc4dc4796a5231be95aeeba8aa4bcbaf3a0541b5032429c2f72e6b02Set Interval328455162023-03-08 4:53:3985 days 14 hrs ago0xcfefd28d3024baaa180a61e6a505f0c9bb5a9e24 IN  0x44e9c30956735b3fba25278d3c610ce2b6594fdb0 MATIC0.000026613 1.000000015
0x2c8dc3333f869c78af5fb2152d0e31299380541db619222c0662e211460b3ba7Set Interval328173692023-03-07 12:16:4586 days 6 hrs ago0xcfefd28d3024baaa180a61e6a505f0c9bb5a9e24 IN  0x44e9c30956735b3fba25278d3c610ce2b6594fdb0 MATIC0.000026613 1.000000016
0x3655fc9f4bc78532d85960efd6665d885fd54ebb42a4731b5d58e7ee0e5a1563Set Interval325830042023-03-01 17:54:1592 days 1 hr ago0xcfefd28d3024baaa180a61e6a505f0c9bb5a9e24 IN  0x44e9c30956735b3fba25278d3c610ce2b6594fdb0 MATIC0.000026625 1.000000019
0x945e667e4c4d31b5d17372d96e6c9a28c1a5da2627010b452bc61bd49b062c460x60806040325697042023-03-01 10:03:0292 days 9 hrs ago0xcfefd28d3024baaa180a61e6a505f0c9bb5a9e24 IN  Create: Counter0 MATIC0.001240627507 2.500000016
[ Download CSV Export 
Parent Txn Hash Block From To Value
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
Counter

Compiler Version
v0.8.7+commit.e28d00a7

Optimization Enabled:
No with 200 runs

Other Settings:
default evmVersion, None license
/**
 *Submitted for verification at polygonscan.com on 2023-03-01
*/

// File: @chainlink/contracts/src/v0.8/interfaces/KeeperCompatibleInterface.sol


pragma solidity ^0.8.0;

interface KeeperCompatibleInterface {
  /**
   * @notice method that is simulated by the keepers to see if any work actually
   * needs to be performed. This method does does not actually need to be
   * executable, and since it is only ever simulated it can consume lots of gas.
   * @dev To ensure that it is never called, you may want to add the
   * cannotExecute modifier from KeeperBase to your implementation of this
   * method.
   * @param checkData specified in the upkeep registration so it is always the
   * same for a registered upkeep. This can easily be broken down into specific
   * arguments using `abi.decode`, so multiple upkeeps can be registered on the
   * same contract and easily differentiated by the contract.
   * @return upkeepNeeded boolean to indicate whether the keeper should call
   * performUpkeep or not.
   * @return performData bytes that the keeper should call performUpkeep with, if
   * upkeep is needed. If you would like to encode data to decode later, try
   * `abi.encode`.
   */
  function checkUpkeep(bytes calldata checkData) external returns (bool upkeepNeeded, bytes memory performData);

  /**
   * @notice method that is actually executed by the keepers, via the registry.
   * The data returned by the checkUpkeep simulation will be passed into
   * this method to actually be executed.
   * @dev The input to this method should not be trusted, and the caller of the
   * method should not even be restricted to any single registry. Anyone should
   * be able call it, and the input should be validated, there is no guarantee
   * that the data passed in is the performData returned from checkUpkeep. This
   * could happen due to malicious keepers, racing keepers, or simply a state
   * change while the performUpkeep transaction is waiting for confirmation.
   * Always validate the data passed in.
   * @param performData is the data which was passed back from the checkData
   * simulation. If it is encoded, it can easily be decoded into other types by
   * calling `abi.decode`. This data should not be trusted, and should be
   * validated against the contract's current state.
   */
  function performUpkeep(bytes calldata performData) external;
}

// File: @chainlink/contracts/src/v0.8/KeeperBase.sol


pragma solidity 0.8.7;

contract KeeperBase {
  error OnlySimulatedBackend();

  /**
   * @notice method that allows it to be simulated via eth_call by checking that
   * the sender is the zero address.
   */
  function preventExecution() internal view {
    if (tx.origin != address(0)) {
      revert OnlySimulatedBackend();
    }
  }

  /**
   * @notice modifier that allows it to be simulated via eth_call by checking
   * that the sender is the zero address.
   */
  modifier cannotExecute() {
    preventExecution();
    _;
  }
}

// File: @chainlink/contracts/src/v0.8/KeeperCompatible.sol


pragma solidity ^0.8.0;



abstract contract KeeperCompatible is KeeperBase, KeeperCompatibleInterface {}

// File: docs.chain.link/samples/Keepers/KeepersCounter.sol


pragma solidity ^0.8.7;

// KeeperCompatible.sol imports the functions from both ./KeeperBase.sol and
// ./interfaces/KeeperCompatibleInterface.sol


contract Counter is KeeperCompatibleInterface {
    /**
    * Public counter variable
    */
    uint public counter;

    /**
    * Use an interval in seconds and a timestamp to slow execution of Upkeep
    */
    uint public interval;
    uint public lastTimeStamp;
    bool public onOffButton;
    event Logger(string message, uint timestamp,uint blocknbr, uint curcount);

    constructor(uint updateInterval) {
      interval = updateInterval;
      lastTimeStamp = block.timestamp;
      onOffButton = true;
      counter = 0;
    }

    function setInterval(uint newInterval) external{
        interval = newInterval;
    }

    function setOnOffButton(bool newval) external{
        onOffButton = newval;
    }

    function checkUpkeep(bytes calldata /* checkData */) external view override returns (bool upkeepNeeded, bytes memory /* performData */) {
        upkeepNeeded = false;
        if (onOffButton){
            upkeepNeeded = (block.timestamp - lastTimeStamp) > interval;
        }
        // We don't use the checkData in this example. The checkData is defined when the Upkeep was registered.
    }

    function performUpkeep(bytes calldata /* performData */) external override {
        //We highly recommend revalidating the upkeep in the performUpkeep function
        if ((block.timestamp - lastTimeStamp) > interval ) {
            lastTimeStamp = block.timestamp;
            counter = counter + 1;
            emit Logger("add 1", block.timestamp,block.number, counter);
        }
        // We don't use the performData in this example. The performData is generated by the Keeper's call to your checkUpkeep function
    }
}

Contract ABI

[{"inputs":[{"internalType":"uint256","name":"updateInterval","type":"uint256"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"string","name":"message","type":"string"},{"indexed":false,"internalType":"uint256","name":"timestamp","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"blocknbr","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"curcount","type":"uint256"}],"name":"Logger","type":"event"},{"inputs":[{"internalType":"bytes","name":"","type":"bytes"}],"name":"checkUpkeep","outputs":[{"internalType":"bool","name":"upkeepNeeded","type":"bool"},{"internalType":"bytes","name":"","type":"bytes"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"counter","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"interval","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"lastTimeStamp","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"onOffButton","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes","name":"","type":"bytes"}],"name":"performUpkeep","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"newInterval","type":"uint256"}],"name":"setInterval","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bool","name":"newval","type":"bool"}],"name":"setOnOffButton","outputs":[],"stateMutability":"nonpayable","type":"function"}]

608060405234801561001057600080fd5b5060405161079a38038061079a8339818101604052810190610032919061007d565b80600181905550426002819055506001600360006101000a81548160ff02191690831515021790555060008081905550506100d0565b600081519050610077816100b9565b92915050565b600060208284031215610093576100926100b4565b5b60006100a184828501610068565b91505092915050565b6000819050919050565b600080fd5b6100c2816100aa565b81146100cd57600080fd5b50565b6106bb806100df6000396000f3fe608060405234801561001057600080fd5b50600436106100885760003560e01c80636e04ff0d1161005b5780636e04ff0d146101015780638d3f4c9514610132578063947a36fb14610150578063a320dc261461016e57610088565b806322a900821461008d5780633f3b3b27146100a95780634585e33b146100c757806361bc221a146100e3575b600080fd5b6100a760048036038101906100a2919061037e565b61018a565b005b6100b1610194565b6040516100be91906104ba565b60405180910390f35b6100e160048036038101906100dc9190610331565b61019a565b005b6100eb61020f565b6040516100f891906104ba565b60405180910390f35b61011b60048036038101906101169190610331565b610215565b604051610129929190610440565b60405180910390f35b61013a61024e565b6040516101479190610425565b60405180910390f35b610158610261565b60405161016591906104ba565b60405180910390f35b61018860048036038101906101839190610304565b610267565b005b8060018190555050565b60025481565b600154600254426101ab9190610558565b111561020b574260028190555060016000546101c79190610502565b6000819055507f9a15fbbf6bc740acc6f7c1a2353076ecedcef50333013292fc17aea47d5e7163424360005460405161020293929190610470565b60405180910390a15b5050565b60005481565b6000606060009150600360009054906101000a900460ff161561024757600154600254426102439190610558565b1191505b9250929050565b600360009054906101000a900460ff1681565b60015481565b80600360006101000a81548160ff02191690831515021790555050565b60008135905061029381610657565b92915050565b60008083601f8401126102af576102ae610609565b5b8235905067ffffffffffffffff8111156102cc576102cb610604565b5b6020830191508360018202830111156102e8576102e761060e565b5b9250929050565b6000813590506102fe8161066e565b92915050565b60006020828403121561031a57610319610618565b5b600061032884828501610284565b91505092915050565b6000806020838503121561034857610347610618565b5b600083013567ffffffffffffffff81111561036657610365610613565b5b61037285828601610299565b92509250509250929050565b60006020828403121561039457610393610618565b5b60006103a2848285016102ef565b91505092915050565b6103b48161058c565b82525050565b60006103c5826104d5565b6103cf81856104e0565b93506103df8185602086016105a2565b6103e88161061d565b840191505092915050565b60006104006005836104f1565b915061040b8261062e565b602082019050919050565b61041f81610598565b82525050565b600060208201905061043a60008301846103ab565b92915050565b600060408201905061045560008301856103ab565b818103602083015261046781846103ba565b90509392505050565b60006080820190508181036000830152610489816103f3565b90506104986020830186610416565b6104a56040830185610416565b6104b26060830184610416565b949350505050565b60006020820190506104cf6000830184610416565b92915050565b600081519050919050565b600082825260208201905092915050565b600082825260208201905092915050565b600061050d82610598565b915061051883610598565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0382111561054d5761054c6105d5565b5b828201905092915050565b600061056382610598565b915061056e83610598565b925082821015610581576105806105d5565b5b828203905092915050565b60008115159050919050565b6000819050919050565b60005b838110156105c05780820151818401526020810190506105a5565b838111156105cf576000848401525b50505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b600080fd5b600080fd5b600080fd5b600080fd5b600080fd5b6000601f19601f8301169050919050565b7f6164642031000000000000000000000000000000000000000000000000000000600082015250565b6106608161058c565b811461066b57600080fd5b50565b61067781610598565b811461068257600080fd5b5056fea26469706673582212202a1d00a552f42074bc0bb20a267a80d79ec9bdd023ba3a97c5166e2b4a6ba46a64736f6c63430008070033000000000000000000000000000000000000000000000000000000000000003c

Constructor Arguments (ABI-Encoded and is the last bytes of the Contract Creation Code above)

000000000000000000000000000000000000000000000000000000000000003c

-----Decoded View---------------
Arg [0] : updateInterval (uint256): 60

-----Encoded View---------------
1 Constructor Arguments found :
Arg [0] : 000000000000000000000000000000000000000000000000000000000000003c


Deployed ByteCode Sourcemap

3383:1698:0:-:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;3948:88;;;;;;;;;;;;;:::i;:::-;;:::i;:::-;;3634:25;;;:::i;:::-;;;;;;;:::i;:::-;;;;;;;;4544:534;;;;;;;;;;;;;:::i;:::-;;:::i;:::-;;3484:19;;;:::i;:::-;;;;;;;:::i;:::-;;;;;;;;4136:400;;;;;;;;;;;;;:::i;:::-;;:::i;:::-;;;;;;;;:::i;:::-;;;;;;;;3666:23;;;:::i;:::-;;;;;;;:::i;:::-;;;;;;;;3607:20;;;:::i;:::-;;;;;;;:::i;:::-;;;;;;;;4044:84;;;;;;;;;;;;;:::i;:::-;;:::i;:::-;;3948:88;4017:11;4006:8;:22;;;;3948:88;:::o;3634:25::-;;;;:::o;4544:534::-;4755:8;;4738:13;;4720:15;:31;;;;:::i;:::-;4719:44;4715:219;;;4797:15;4781:13;:31;;;;4847:1;4837:7;;:11;;;;:::i;:::-;4827:7;:21;;;;4868:54;4884:15;4900:12;4914:7;;4868:54;;;;;;;;:::i;:::-;;;;;;;;4715:219;4544:534;;:::o;3484:19::-;;;;:::o;4136:400::-;4221:17;4240:12;4298:5;4283:20;;4318:11;;;;;;;;;;;4314:102;;;4396:8;;4379:13;;4361:15;:31;;;;:::i;:::-;4360:44;4345:59;;4314:102;4136:400;;;;;:::o;3666:23::-;;;;;;;;;;;;;:::o;3607:20::-;;;;:::o;4044:84::-;4114:6;4100:11;;:20;;;;;;;;;;;;;;;;;;4044:84;:::o;7:133:1:-;50:5;88:6;75:20;66:29;;104:30;128:5;104:30;:::i;:::-;7:133;;;;:::o;159:552::-;216:8;226:6;276:3;269:4;261:6;257:17;253:27;243:122;;284:79;;:::i;:::-;243:122;397:6;384:20;374:30;;427:18;419:6;416:30;413:117;;;449:79;;:::i;:::-;413:117;563:4;555:6;551:17;539:29;;617:3;609:4;601:6;597:17;587:8;583:32;580:41;577:128;;;624:79;;:::i;:::-;577:128;159:552;;;;;:::o;717:139::-;763:5;801:6;788:20;779:29;;817:33;844:5;817:33;:::i;:::-;717:139;;;;:::o;862:323::-;918:6;967:2;955:9;946:7;942:23;938:32;935:119;;;973:79;;:::i;:::-;935:119;1093:1;1118:50;1160:7;1151:6;1140:9;1136:22;1118:50;:::i;:::-;1108:60;;1064:114;862:323;;;;:::o;1191:527::-;1261:6;1269;1318:2;1306:9;1297:7;1293:23;1289:32;1286:119;;;1324:79;;:::i;:::-;1286:119;1472:1;1461:9;1457:17;1444:31;1502:18;1494:6;1491:30;1488:117;;;1524:79;;:::i;:::-;1488:117;1637:64;1693:7;1684:6;1673:9;1669:22;1637:64;:::i;:::-;1619:82;;;;1415:296;1191:527;;;;;:::o;1724:329::-;1783:6;1832:2;1820:9;1811:7;1807:23;1803:32;1800:119;;;1838:79;;:::i;:::-;1800:119;1958:1;1983:53;2028:7;2019:6;2008:9;2004:22;1983:53;:::i;:::-;1973:63;;1929:117;1724:329;;;;:::o;2059:109::-;2140:21;2155:5;2140:21;:::i;:::-;2135:3;2128:34;2059:109;;:::o;2174:360::-;2260:3;2288:38;2320:5;2288:38;:::i;:::-;2342:70;2405:6;2400:3;2342:70;:::i;:::-;2335:77;;2421:52;2466:6;2461:3;2454:4;2447:5;2443:16;2421:52;:::i;:::-;2498:29;2520:6;2498:29;:::i;:::-;2493:3;2489:39;2482:46;;2264:270;2174:360;;;;:::o;2540:365::-;2682:3;2703:66;2767:1;2762:3;2703:66;:::i;:::-;2696:73;;2778:93;2867:3;2778:93;:::i;:::-;2896:2;2891:3;2887:12;2880:19;;2540:365;;;:::o;2911:118::-;2998:24;3016:5;2998:24;:::i;:::-;2993:3;2986:37;2911:118;;:::o;3035:210::-;3122:4;3160:2;3149:9;3145:18;3137:26;;3173:65;3235:1;3224:9;3220:17;3211:6;3173:65;:::i;:::-;3035:210;;;;:::o;3251:407::-;3384:4;3422:2;3411:9;3407:18;3399:26;;3435:65;3497:1;3486:9;3482:17;3473:6;3435:65;:::i;:::-;3547:9;3541:4;3537:20;3532:2;3521:9;3517:18;3510:48;3575:76;3646:4;3637:6;3575:76;:::i;:::-;3567:84;;3251:407;;;;;:::o;3664:750::-;3914:4;3952:3;3941:9;3937:19;3929:27;;4002:9;3996:4;3992:20;3988:1;3977:9;3973:17;3966:47;4030:131;4156:4;4030:131;:::i;:::-;4022:139;;4171:72;4239:2;4228:9;4224:18;4215:6;4171:72;:::i;:::-;4253;4321:2;4310:9;4306:18;4297:6;4253:72;:::i;:::-;4335;4403:2;4392:9;4388:18;4379:6;4335:72;:::i;:::-;3664:750;;;;;;:::o;4420:222::-;4513:4;4551:2;4540:9;4536:18;4528:26;;4564:71;4632:1;4621:9;4617:17;4608:6;4564:71;:::i;:::-;4420:222;;;;:::o;4729:98::-;4780:6;4814:5;4808:12;4798:22;;4729:98;;;:::o;4833:168::-;4916:11;4950:6;4945:3;4938:19;4990:4;4985:3;4981:14;4966:29;;4833:168;;;;:::o;5007:169::-;5091:11;5125:6;5120:3;5113:19;5165:4;5160:3;5156:14;5141:29;;5007:169;;;;:::o;5182:305::-;5222:3;5241:20;5259:1;5241:20;:::i;:::-;5236:25;;5275:20;5293:1;5275:20;:::i;:::-;5270:25;;5429:1;5361:66;5357:74;5354:1;5351:81;5348:107;;;5435:18;;:::i;:::-;5348:107;5479:1;5476;5472:9;5465:16;;5182:305;;;;:::o;5493:191::-;5533:4;5553:20;5571:1;5553:20;:::i;:::-;5548:25;;5587:20;5605:1;5587:20;:::i;:::-;5582:25;;5626:1;5623;5620:8;5617:34;;;5631:18;;:::i;:::-;5617:34;5676:1;5673;5669:9;5661:17;;5493:191;;;;:::o;5690:90::-;5724:7;5767:5;5760:13;5753:21;5742:32;;5690:90;;;:::o;5786:77::-;5823:7;5852:5;5841:16;;5786:77;;;:::o;5869:307::-;5937:1;5947:113;5961:6;5958:1;5955:13;5947:113;;;6046:1;6041:3;6037:11;6031:18;6027:1;6022:3;6018:11;6011:39;5983:2;5980:1;5976:10;5971:15;;5947:113;;;6078:6;6075:1;6072:13;6069:101;;;6158:1;6149:6;6144:3;6140:16;6133:27;6069:101;5918:258;5869:307;;;:::o;6182:180::-;6230:77;6227:1;6220:88;6327:4;6324:1;6317:15;6351:4;6348:1;6341:15;6368:117;6477:1;6474;6467:12;6491:117;6600:1;6597;6590:12;6614:117;6723:1;6720;6713:12;6737:117;6846:1;6843;6836:12;6860:117;6969:1;6966;6959:12;6983:102;7024:6;7075:2;7071:7;7066:2;7059:5;7055:14;7051:28;7041:38;;6983:102;;;:::o;7091:155::-;7231:7;7227:1;7219:6;7215:14;7208:31;7091:155;:::o;7252:116::-;7322:21;7337:5;7322:21;:::i;:::-;7315:5;7312:32;7302:60;;7358:1;7355;7348:12;7302:60;7252:116;:::o;7374:122::-;7447:24;7465:5;7447:24;:::i;:::-;7440:5;7437:35;7427:63;;7486:1;7483;7476:12;7427:63;7374:122;:::o

Swarm Source

ipfs://2a1d00a552f42074bc0bb20a267a80d79ec9bdd023ba3a97c5166e2b4a6ba46a
Block Transaction Gas Used Reward
Age Block Fee Address BC Fee Address Voting Power Jailed Incoming
Block Uncle Number Difficulty Gas Used Reward
Loading