S Price: $0.81224 (+1.29%)

Contract

0xe32994f5b8788F4f8CBabD1a298360A2b09B9654

Overview

S Balance

Sonic LogoSonic LogoSonic Logo0 S

S Value

$0.00

Multichain Info

No addresses found
Transaction Hash
Method
Block
From
To
Call Harvest83905432025-02-18 4:03:225 days ago1739851402IN
0xe32994f5...2b09B9654
0 S0.091587755
Call Harvest For...83904612025-02-18 4:02:415 days ago1739851361IN
0xe32994f5...2b09B9654
0 S0.0136183355
Add Harvest Cont...83902452025-02-18 4:01:195 days ago1739851279IN
0xe32994f5...2b09B9654
0 S0.0026017755

Parent Transaction Hash Block From To
View All Internal Transactions
Loading...
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
SonicHarvestCaller

Compiler Version
v0.8.28+commit.7893614a

Optimization Enabled:
Yes with 200 runs

Other Settings:
istanbul EvmVersion, MIT license
/**
 *Submitted for verification at SonicScan.org on 2025-02-18
*/

// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;

interface IHarvest {
    function harvest() external;
}

contract SonicHarvestCaller {
    address public owner;
    mapping(address => bool) public harvestContracts;

    event ContractAdded(address indexed contractAddress);
    event ContractRemoved(address indexed contractAddress);
    event HarvestCalled(address indexed contractAddress);

    modifier onlyOwner() {
        require(msg.sender == owner, "Not the owner");
        _;
    }

    constructor() {
        owner = msg.sender;
    }

    function addHarvestContract(address _contract) external onlyOwner {
        require(_contract != address(0), "Invalid address");
        harvestContracts[_contract] = true;
        emit ContractAdded(_contract);
    }

    function removeHarvestContract(address _contract) external onlyOwner {
        require(harvestContracts[_contract], "Contract not found");
        harvestContracts[_contract] = false;
        emit ContractRemoved(_contract);
    }

    function callHarvest(address _contract) external {
        require(harvestContracts[_contract], "Contract not authorized");
        IHarvest(_contract).harvest();
        emit HarvestCalled(_contract);
    }

    function callHarvestForAll() external {
        for (uint256 i = 0; i < 100; i++) { // Prevent gas limit issues
            address contractAddress = address(uint160(i));
            if (harvestContracts[contractAddress]) {
                IHarvest(contractAddress).harvest();
                emit HarvestCalled(contractAddress);
            }
        }
    }
}

Contract Security Audit

Contract ABI

[{"inputs":[],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"contractAddress","type":"address"}],"name":"ContractAdded","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"contractAddress","type":"address"}],"name":"ContractRemoved","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"contractAddress","type":"address"}],"name":"HarvestCalled","type":"event"},{"inputs":[{"internalType":"address","name":"_contract","type":"address"}],"name":"addHarvestContract","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_contract","type":"address"}],"name":"callHarvest","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"callHarvestForAll","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"harvestContracts","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_contract","type":"address"}],"name":"removeHarvestContract","outputs":[],"stateMutability":"nonpayable","type":"function"}]

6080604052348015600f57600080fd5b50600080546001600160a01b031916331790556104fd806100316000396000f3fe608060405234801561001057600080fd5b50600436106100615760003560e01c8062ff79e8146100665780633febe047146100705780636525727c146100a857806370618edb146100bb5780637547566f146100ce5780638da5cb5b146100e1575b600080fd5b61006e61010c565b005b61009361007e366004610497565b60016020526000908152604090205460ff1681565b60405190151581526020015b60405180910390f35b61006e6100b6366004610497565b6101cf565b61006e6100c9366004610497565b6102c6565b61006e6100dc366004610497565b6103b6565b6000546100f4906001600160a01b031681565b6040516001600160a01b03909116815260200161009f565b60005b60648110156101cc576001600160a01b038116600090815260016020526040902054819060ff16156101c357806001600160a01b0316634641257d6040518163ffffffff1660e01b8152600401600060405180830381600087803b15801561017657600080fd5b505af115801561018a573d6000803e3d6000fd5b50506040516001600160a01b03841692507f19a70141f773183123abd11a9cb9a057039859012c2771beadf94e27b54d7a2c9150600090a25b5060010161010f565b50565b6001600160a01b03811660009081526001602052604090205460ff1661023c5760405162461bcd60e51b815260206004820152601760248201527f436f6e7472616374206e6f7420617574686f72697a656400000000000000000060448201526064015b60405180910390fd5b806001600160a01b0316634641257d6040518163ffffffff1660e01b8152600401600060405180830381600087803b15801561027757600080fd5b505af115801561028b573d6000803e3d6000fd5b50506040516001600160a01b03841692507f19a70141f773183123abd11a9cb9a057039859012c2771beadf94e27b54d7a2c9150600090a250565b6000546001600160a01b031633146103105760405162461bcd60e51b815260206004820152600d60248201526c2737ba103a34329037bbb732b960991b6044820152606401610233565b6001600160a01b03811660009081526001602052604090205460ff1661036d5760405162461bcd60e51b815260206004820152601260248201527110dbdb9d1c9858dd081b9bdd08199bdd5b9960721b6044820152606401610233565b6001600160a01b038116600081815260016020526040808220805460ff19169055517f8d30d41865a0b811b9545d879520d2dde9f4cc49e4241f486ad9752bc904b5659190a250565b6000546001600160a01b031633146104005760405162461bcd60e51b815260206004820152600d60248201526c2737ba103a34329037bbb732b960991b6044820152606401610233565b6001600160a01b0381166104485760405162461bcd60e51b815260206004820152600f60248201526e496e76616c6964206164647265737360881b6044820152606401610233565b6001600160a01b0381166000818152600160208190526040808320805460ff1916909217909155517f89c66952b48f3e96bf1d8ba1b63189520fd988a6979b8b740bd5c5d8dc53e2059190a250565b6000602082840312156104a957600080fd5b81356001600160a01b03811681146104c057600080fd5b939250505056fea2646970667358221220edfefc3117ae74e5321a258b48223d72e6ee752fb958655cb592b4f9f5bdd29d64736f6c634300081c0033

Deployed Bytecode

0x608060405234801561001057600080fd5b50600436106100615760003560e01c8062ff79e8146100665780633febe047146100705780636525727c146100a857806370618edb146100bb5780637547566f146100ce5780638da5cb5b146100e1575b600080fd5b61006e61010c565b005b61009361007e366004610497565b60016020526000908152604090205460ff1681565b60405190151581526020015b60405180910390f35b61006e6100b6366004610497565b6101cf565b61006e6100c9366004610497565b6102c6565b61006e6100dc366004610497565b6103b6565b6000546100f4906001600160a01b031681565b6040516001600160a01b03909116815260200161009f565b60005b60648110156101cc576001600160a01b038116600090815260016020526040902054819060ff16156101c357806001600160a01b0316634641257d6040518163ffffffff1660e01b8152600401600060405180830381600087803b15801561017657600080fd5b505af115801561018a573d6000803e3d6000fd5b50506040516001600160a01b03841692507f19a70141f773183123abd11a9cb9a057039859012c2771beadf94e27b54d7a2c9150600090a25b5060010161010f565b50565b6001600160a01b03811660009081526001602052604090205460ff1661023c5760405162461bcd60e51b815260206004820152601760248201527f436f6e7472616374206e6f7420617574686f72697a656400000000000000000060448201526064015b60405180910390fd5b806001600160a01b0316634641257d6040518163ffffffff1660e01b8152600401600060405180830381600087803b15801561027757600080fd5b505af115801561028b573d6000803e3d6000fd5b50506040516001600160a01b03841692507f19a70141f773183123abd11a9cb9a057039859012c2771beadf94e27b54d7a2c9150600090a250565b6000546001600160a01b031633146103105760405162461bcd60e51b815260206004820152600d60248201526c2737ba103a34329037bbb732b960991b6044820152606401610233565b6001600160a01b03811660009081526001602052604090205460ff1661036d5760405162461bcd60e51b815260206004820152601260248201527110dbdb9d1c9858dd081b9bdd08199bdd5b9960721b6044820152606401610233565b6001600160a01b038116600081815260016020526040808220805460ff19169055517f8d30d41865a0b811b9545d879520d2dde9f4cc49e4241f486ad9752bc904b5659190a250565b6000546001600160a01b031633146104005760405162461bcd60e51b815260206004820152600d60248201526c2737ba103a34329037bbb732b960991b6044820152606401610233565b6001600160a01b0381166104485760405162461bcd60e51b815260206004820152600f60248201526e496e76616c6964206164647265737360881b6044820152606401610233565b6001600160a01b0381166000818152600160208190526040808320805460ff1916909217909155517f89c66952b48f3e96bf1d8ba1b63189520fd988a6979b8b740bd5c5d8dc53e2059190a250565b6000602082840312156104a957600080fd5b81356001600160a01b03811681146104c057600080fd5b939250505056fea2646970667358221220edfefc3117ae74e5321a258b48223d72e6ee752fb958655cb592b4f9f5bdd29d64736f6c634300081c0033

Deployed Bytecode Sourcemap

121:1524:0:-:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;1275:367;;;:::i;:::-;;183:48;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;470:14:1;;463:22;445:41;;433:2;418:18;183:48:0;;;;;;;;1056:211;;;;;;:::i;:::-;;:::i;814:234::-;;;;;;:::i;:::-;;:::i;585:221::-;;;;;;:::i;:::-;;:::i;156:20::-;;;;;-1:-1:-1;;;;;156:20:0;;;;;;-1:-1:-1;;;;;661:32:1;;;643:51;;631:2;616:18;156:20:0;497:203:1;1275:367:0;1329:9;1324:311;1348:3;1344:1;:7;1324:311;;;-1:-1:-1;;;;;1465:33:0;;1401:23;1465:33;;;:16;:33;;;;;;1443:1;;1465:33;;1461:163;;;1528:15;-1:-1:-1;;;;;1519:33:0;;:35;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;;1578:30:0;;-1:-1:-1;;;;;1578:30:0;;;-1:-1:-1;1578:30:0;;-1:-1:-1;1578:30:0;;;1461:163;-1:-1:-1;1353:3:0;;1324:311;;;;1275:367::o;1056:211::-;-1:-1:-1;;;;;1124:27:0;;;;;;:16;:27;;;;;;;;1116:63;;;;-1:-1:-1;;;1116:63:0;;907:2:1;1116:63:0;;;889:21:1;946:2;926:18;;;919:30;985:25;965:18;;;958:53;1028:18;;1116:63:0;;;;;;;;;1199:9;-1:-1:-1;;;;;1190:27:0;;:29;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;;1235:24:0;;-1:-1:-1;;;;;1235:24:0;;;-1:-1:-1;1235:24:0;;-1:-1:-1;1235:24:0;;;1056:211;:::o;814:234::-;475:5;;-1:-1:-1;;;;;475:5:0;461:10;:19;453:45;;;;-1:-1:-1;;;453:45:0;;1259:2:1;453:45:0;;;1241:21:1;1298:2;1278:18;;;1271:30;-1:-1:-1;;;1317:18:1;;;1310:43;1370:18;;453:45:0;1057:337:1;453:45:0;-1:-1:-1;;;;;902:27:0;::::1;;::::0;;;:16:::1;:27;::::0;;;;;::::1;;894:58;;;::::0;-1:-1:-1;;;894:58:0;;1601:2:1;894:58:0::1;::::0;::::1;1583:21:1::0;1640:2;1620:18;;;1613:30;-1:-1:-1;;;1659:18:1;;;1652:48;1717:18;;894:58:0::1;1399:342:1::0;894:58:0::1;-1:-1:-1::0;;;;;963:27:0;::::1;993:5;963:27:::0;;;:16:::1;:27;::::0;;;;;:35;;-1:-1:-1;;963:35:0::1;::::0;;1014:26;::::1;::::0;993:5;1014:26:::1;814:234:::0;:::o;585:221::-;475:5;;-1:-1:-1;;;;;475:5:0;461:10;:19;453:45;;;;-1:-1:-1;;;453:45:0;;1259:2:1;453:45:0;;;1241:21:1;1298:2;1278:18;;;1271:30;-1:-1:-1;;;1317:18:1;;;1310:43;1370:18;;453:45:0;1057:337:1;453:45:0;-1:-1:-1;;;;;670:23:0;::::1;662:51;;;::::0;-1:-1:-1;;;662:51:0;;1948:2:1;662:51:0::1;::::0;::::1;1930:21:1::0;1987:2;1967:18;;;1960:30;-1:-1:-1;;;2006:18:1;;;1999:45;2061:18;;662:51:0::1;1746:339:1::0;662:51:0::1;-1:-1:-1::0;;;;;724:27:0;::::1;;::::0;;;754:4:::1;724:27;::::0;;;;;;;:34;;-1:-1:-1;;724:34:0::1;::::0;;::::1;::::0;;;774:24;::::1;::::0;724:27;774:24:::1;585:221:::0;:::o;14:286:1:-;73:6;126:2;114:9;105:7;101:23;97:32;94:52;;;142:1;139;132:12;94:52;168:23;;-1:-1:-1;;;;;220:31:1;;210:42;;200:70;;266:1;263;256:12;200:70;289:5;14:286;-1:-1:-1;;;14:286:1:o

Swarm Source

ipfs://edfefc3117ae74e5321a258b48223d72e6ee752fb958655cb592b4f9f5bdd29d

Block Transaction Gas Used Reward
view all blocks produced

Block Uncle Number Difficulty Gas Used Reward
View All Uncles
Loading...
Loading
Loading...
Loading

Validator Index Block Amount
View All Withdrawals

Transaction Hash Block Value Eth2 PubKey Valid
View All Deposits
[ Download: CSV Export  ]

A contract address hosts a smart contract, which is a set of code stored on the blockchain that runs when predetermined conditions are met. Learn more about addresses in our Knowledge Base.