Contract

0x6f3cBE2ab3483EC4BA7B672fbdCa0E9B33F88db8

Overview

S Balance

Sonic LogoSonic LogoSonic Logo0 S

S Value

-

Multichain Info

No addresses found
Transaction Hash
Method
Block
From
To

There are no matching entries

1 Internal Transaction found.

Latest 1 internal transaction

Parent Transaction Hash Block From To
3077742024-12-11 19:07:5922 days ago1733944079  Contract Creation0 S
Loading...
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
InitGov

Compiler Version
v0.8.18+commit.87f61d96

Optimization Enabled:
Yes with 200 runs

Other Settings:
default evmVersion, GNU AGPLv3 license
/**
 *Submitted for verification at SonicScan.org on 2024-12-12
*/

/**
 *Submitted for verification at Etherscan.io on 2024-09-24
*/

// SPDX-License-Identifier: AGPL-3.0
pragma solidity >=0.8.18 ^0.8.18;

// src/utils/Governance.sol

contract Governance {
    /// @notice Emitted when the governance address is updated.
    event GovernanceTransferred(
        address indexed previousGovernance,
        address indexed newGovernance
    );

    modifier onlyGovernance() {
        _checkGovernance();
        _;
    }

    /// @notice Checks if the msg sender is the governance.
    function _checkGovernance() internal view virtual {
        require(governance == msg.sender, "!governance");
    }

    /// @notice Address that can set the default base fee and provider
    address public governance;

    constructor(address _governance) {
        governance = _governance;

        emit GovernanceTransferred(address(0), _governance);
    }

    /**
     * @notice Sets a new address as the governance of the contract.
     * @dev Throws if the caller is not current governance.
     * @param _newGovernance The new governance address.
     */
    function transferGovernance(
        address _newGovernance
    ) external virtual onlyGovernance {
        require(_newGovernance != address(0), "ZERO ADDRESS");
        address oldGovernance = governance;
        governance = _newGovernance;

        emit GovernanceTransferred(oldGovernance, _newGovernance);
    }
}

// src/utils/InitGov.sol

/// @notice Multi chain contract to be the initial governance for contracts on deployment.
contract InitGov {
    address public constant SAFE = 0x33333333D5eFb92f19a5F94a43456b3cec2797AE;

    address public constant SIGNER_ONE =
        0x6d2b80BA79871281Be7F70b079996a052B8D62F4;
    address public constant SIGNER_TWO =
        0x305af52AC31d3F9Daa1EC6231bA7b36Bb40f42f4;
    address public constant SIGNER_THREE =
        0xa05c4256ff0dd38697e63D48dF146e6e2FE7fe4A;
    address public constant SIGNER_FOUR =
        0x623d4A04e19328244924D1dee48252987C02fC0a;
    address public constant SIGNER_FIVE =
        0x5C166A5919cC07d785837d8Cc1261c67229d271D;
    address public constant SIGNER_SIX =
        0x80f751EdcB3012d5AF5530AFE97d5dC6EE176Bc0;

    uint256 public constant THRESHOLD = 3;

    mapping(address => bool) public isSigner;

    mapping(bytes32 => uint256) public numberSigned;

    mapping(address => mapping(bytes32 => bool)) public signed;

    constructor() {
        isSigner[SIGNER_ONE] = true;
        isSigner[SIGNER_TWO] = true;
        isSigner[SIGNER_THREE] = true;
        isSigner[SIGNER_FOUR] = true;
        isSigner[SIGNER_FIVE] = true;
        isSigner[SIGNER_SIX] = true;
    }

    /// @notice To sign a txn from an eoa.
    function signTxn(address _contract, address _newGovernance) external {
        require(isSigner[msg.sender], "!signer");
        bytes32 id = getTxnId(_contract, _newGovernance);
        require(!signed[msg.sender][id], "already signed");

        signed[msg.sender][id] = true;
        numberSigned[id] += 1;

        // Execute if we have reached the threshold.
        if (numberSigned[id] == THRESHOLD)
            _transferGovernance(_contract, _newGovernance);
    }

    /// @notice Can only be called by safe
    function transferGovernance(
        address _contract,
        address _newGovernance
    ) external {
        require(msg.sender == SAFE, "!safe");
        _transferGovernance(_contract, _newGovernance);
    }

    function _transferGovernance(
        address _contract,
        address _newGovernance
    ) internal {
        Governance(_contract).transferGovernance(_newGovernance);
    }

    function getTxnId(
        address _contract,
        address _newGovernance
    ) public pure returns (bytes32) {
        return keccak256(abi.encodePacked(_contract, _newGovernance));
    }
}

Contract Security Audit

Contract ABI

[{"inputs":[],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[],"name":"SAFE","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"SIGNER_FIVE","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"SIGNER_FOUR","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"SIGNER_ONE","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"SIGNER_SIX","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"SIGNER_THREE","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"SIGNER_TWO","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"THRESHOLD","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_contract","type":"address"},{"internalType":"address","name":"_newGovernance","type":"address"}],"name":"getTxnId","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"pure","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"isSigner","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"name":"numberSigned","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_contract","type":"address"},{"internalType":"address","name":"_newGovernance","type":"address"}],"name":"signTxn","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"},{"internalType":"bytes32","name":"","type":"bytes32"}],"name":"signed","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_contract","type":"address"},{"internalType":"address","name":"_newGovernance","type":"address"}],"name":"transferGovernance","outputs":[],"stateMutability":"nonpayable","type":"function"}]

608060405234801561001057600080fd5b50600060208190527f94e6b1a9af635ff10f59c99e2f78fdeddf547e5a57ea5ffaddc83818598b61f9805460ff1990811660019081179092557f09b7965b32af889074b52d6f027c8415b9b5e1b03a02e45a11bdb065b7609b1180548216831790557fe48633bec7b9921df9a69155d3d9dfb315dba500ea1a1dd26e4014ba3afdcb2680548216831790557f83b80d6cb6be1713a5761561a2d8477c3a7270f51c8ac79b541cafa2319ef5bf80548216831790557f813e88487525924c9e019f7660c84d9bc5df282c7c646274b63002bad3ac746080548216831790557380f751edcb3012d5af5530afe97d5dc6ee176bc09092527fdd12a6afe756ccc5956fc5ec60a5a3db5d2a062f75d60189cb5f0e758508a6f280549092161790556105cc8061013d6000396000f3fe608060405234801561001057600080fd5b50600436106100ea5760003560e01c8063807d41d41161008c578063aa5bfd6b11610066578063aa5bfd6b14610237578063d62bda0914610252578063eb7caede1461026d578063fd813da11461028857600080fd5b8063807d41d4146101ce578063885a1ffa146101ee57806389c40e951461020957600080fd5b80636fb1d52f116100c85780636fb1d52f1461014f578063785ffb371461016a5780637b1c5569146101805780637df73e271461019b57600080fd5b80630219108a146100ef5780632058f181146101045780635a116aae14610117575b600080fd5b6101026100fd3660046104dd565b61029b565b005b6101026101123660046104dd565b6102f9565b6101327380f751edcb3012d5af5530afe97d5dc6ee176bc081565b6040516001600160a01b0390911681526020015b60405180910390f35b610132736d2b80ba79871281be7f70b079996a052b8d62f481565b610172600381565b604051908152602001610146565b61013273623d4a04e19328244924d1dee48252987c02fc0a81565b6101be6101a9366004610510565b60006020819052908152604090205460ff1681565b6040519015158152602001610146565b6101726101dc366004610532565b60016020526000908152604090205481565b6101327333333333d5efb92f19a5f94a43456b3cec2797ae81565b6101be61021736600461054b565b600260209081526000928352604080842090915290825290205460ff1681565b610132735c166a5919cc07d785837d8cc1261c67229d271d81565b61013273305af52ac31d3f9daa1ec6231ba7b36bb40f42f481565b61013273a05c4256ff0dd38697e63d48df146e6e2fe7fe4a81565b6101726102963660046104dd565b610417565b337333333333d5efb92f19a5f94a43456b3cec2797ae146102eb5760405162461bcd60e51b8152602060048201526005602482015264217361666560d81b60448201526064015b60405180910390fd5b6102f58282610462565b5050565b3360009081526020819052604090205460ff166103425760405162461bcd60e51b815260206004820152600760248201526610b9b4b3b732b960c91b60448201526064016102e2565b600061034e8383610417565b33600090815260026020908152604080832084845290915290205490915060ff16156103ad5760405162461bcd60e51b815260206004820152600e60248201526d185b1c9958591e481cda59db995960921b60448201526064016102e2565b3360009081526002602090815260408083208484528252808320805460ff191660019081179091559182905282208054919290916103ec908490610575565b909155505060008181526001602052604090205460021901610412576104128383610462565b505050565b6040516bffffffffffffffffffffffff19606084811b8216602084015283901b1660348201526000906048016040516020818303038152906040528051906020012090505b92915050565b6040516334e2fffd60e21b81526001600160a01b03828116600483015283169063d38bfff490602401600060405180830381600087803b1580156104a557600080fd5b505af11580156104b9573d6000803e3d6000fd5b505050505050565b80356001600160a01b03811681146104d857600080fd5b919050565b600080604083850312156104f057600080fd5b6104f9836104c1565b9150610507602084016104c1565b90509250929050565b60006020828403121561052257600080fd5b61052b826104c1565b9392505050565b60006020828403121561054457600080fd5b5035919050565b6000806040838503121561055e57600080fd5b610567836104c1565b946020939093013593505050565b8082018082111561045c57634e487b7160e01b600052601160045260246000fdfea264697066735822122065ad5ddd0a09f6e3b64901a632698a2f6ebfbbf95f99a263fb64a5939ae4d51f64736f6c63430008120033

Deployed Bytecode

0x608060405234801561001057600080fd5b50600436106100ea5760003560e01c8063807d41d41161008c578063aa5bfd6b11610066578063aa5bfd6b14610237578063d62bda0914610252578063eb7caede1461026d578063fd813da11461028857600080fd5b8063807d41d4146101ce578063885a1ffa146101ee57806389c40e951461020957600080fd5b80636fb1d52f116100c85780636fb1d52f1461014f578063785ffb371461016a5780637b1c5569146101805780637df73e271461019b57600080fd5b80630219108a146100ef5780632058f181146101045780635a116aae14610117575b600080fd5b6101026100fd3660046104dd565b61029b565b005b6101026101123660046104dd565b6102f9565b6101327380f751edcb3012d5af5530afe97d5dc6ee176bc081565b6040516001600160a01b0390911681526020015b60405180910390f35b610132736d2b80ba79871281be7f70b079996a052b8d62f481565b610172600381565b604051908152602001610146565b61013273623d4a04e19328244924d1dee48252987c02fc0a81565b6101be6101a9366004610510565b60006020819052908152604090205460ff1681565b6040519015158152602001610146565b6101726101dc366004610532565b60016020526000908152604090205481565b6101327333333333d5efb92f19a5f94a43456b3cec2797ae81565b6101be61021736600461054b565b600260209081526000928352604080842090915290825290205460ff1681565b610132735c166a5919cc07d785837d8cc1261c67229d271d81565b61013273305af52ac31d3f9daa1ec6231ba7b36bb40f42f481565b61013273a05c4256ff0dd38697e63d48df146e6e2fe7fe4a81565b6101726102963660046104dd565b610417565b337333333333d5efb92f19a5f94a43456b3cec2797ae146102eb5760405162461bcd60e51b8152602060048201526005602482015264217361666560d81b60448201526064015b60405180910390fd5b6102f58282610462565b5050565b3360009081526020819052604090205460ff166103425760405162461bcd60e51b815260206004820152600760248201526610b9b4b3b732b960c91b60448201526064016102e2565b600061034e8383610417565b33600090815260026020908152604080832084845290915290205490915060ff16156103ad5760405162461bcd60e51b815260206004820152600e60248201526d185b1c9958591e481cda59db995960921b60448201526064016102e2565b3360009081526002602090815260408083208484528252808320805460ff191660019081179091559182905282208054919290916103ec908490610575565b909155505060008181526001602052604090205460021901610412576104128383610462565b505050565b6040516bffffffffffffffffffffffff19606084811b8216602084015283901b1660348201526000906048016040516020818303038152906040528051906020012090505b92915050565b6040516334e2fffd60e21b81526001600160a01b03828116600483015283169063d38bfff490602401600060405180830381600087803b1580156104a557600080fd5b505af11580156104b9573d6000803e3d6000fd5b505050505050565b80356001600160a01b03811681146104d857600080fd5b919050565b600080604083850312156104f057600080fd5b6104f9836104c1565b9150610507602084016104c1565b90509250929050565b60006020828403121561052257600080fd5b61052b826104c1565b9392505050565b60006020828403121561054457600080fd5b5035919050565b6000806040838503121561055e57600080fd5b610567836104c1565b946020939093013593505050565b8082018082111561045c57634e487b7160e01b600052601160045260246000fdfea264697066735822122065ad5ddd0a09f6e3b64901a632698a2f6ebfbbf95f99a263fb64a5939ae4d51f64736f6c63430008120033

Deployed Bytecode Sourcemap

1579:2354:0:-:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;3320:217;;;;;;:::i;:::-;;:::i;:::-;;2785:483;;;;;;:::i;:::-;;:::i;2164:88::-;;2210:42;2164:88;;;;;-1:-1:-1;;;;;621:32:1;;;603:51;;591:2;576:18;2164:88:0;;;;;;;;1685;;1731:42;1685:88;;2261:37;;2297:1;2261:37;;;;;811:25:1;;;799:2;784:18;2261:37:0;665:177:1;1972:89:0;;2019:42;1972:89;;2307:40;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;1203:14:1;;1196:22;1178:41;;1166:2;1151:18;2307:40:0;1038:187:1;2356:47:0;;;;;;:::i;:::-;;;;;;;;;;;;;;1603:73;;1634:42;1603:73;;2412:58;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;2068:89;;2115:42;2068:89;;1780:88;;1826:42;1780:88;;1875:90;;1923:42;1875:90;;3734:196;;;;;;:::i;:::-;;:::i;3320:217::-;3444:10;1634:42;3444:18;3436:36;;;;-1:-1:-1;;;3436:36:0;;2058:2:1;3436:36:0;;;2040:21:1;2097:1;2077:18;;;2070:29;-1:-1:-1;;;2115:18:1;;;2108:35;2160:18;;3436:36:0;;;;;;;;;3483:46;3503:9;3514:14;3483:19;:46::i;:::-;3320:217;;:::o;2785:483::-;2882:10;2873:8;:20;;;;;;;;;;;;;2865:40;;;;-1:-1:-1;;;2865:40:0;;2391:2:1;2865:40:0;;;2373:21:1;2430:1;2410:18;;;2403:29;-1:-1:-1;;;2448:18:1;;;2441:37;2495:18;;2865:40:0;2189:330:1;2865:40:0;2916:10;2929:35;2938:9;2949:14;2929:8;:35::i;:::-;2991:10;2984:18;;;;:6;:18;;;;;;;;:22;;;;;;;;;2916:48;;-1:-1:-1;2984:22:0;;2983:23;2975:50;;;;-1:-1:-1;;;2975:50:0;;2726:2:1;2975:50:0;;;2708:21:1;2765:2;2745:18;;;2738:30;-1:-1:-1;;;2784:18:1;;;2777:44;2838:18;;2975:50:0;2524:338:1;2975:50:0;3045:10;3038:18;;;;:6;:18;;;;;;;;:22;;;;;;;;:29;;-1:-1:-1;;3038:29:0;3063:4;3038:29;;;;;;3078:16;;;;;;:21;;3063:4;;3078:16;;:21;;3063:4;;3078:21;:::i;:::-;;;;-1:-1:-1;;3170:16:0;;;;:12;:16;;;;;;-1:-1:-1;;3170:29:0;3166:94;;3214:46;3234:9;3245:14;3214:19;:46::i;:::-;2854:414;2785:483;;:::o;3734:196::-;3878:43;;-1:-1:-1;;3321:2:1;3317:15;;;3313:24;;3878:43:0;;;3301:37:1;3372:15;;;3368:24;3354:12;;;3347:46;3841:7:0;;3409:12:1;;3878:43:0;;;;;;;;;;;;3868:54;;;;;;3861:61;;3734:196;;;;;:::o;3545:181::-;3662:56;;-1:-1:-1;;;3662:56:0;;-1:-1:-1;;;;;621:32:1;;;3662:56:0;;;603:51:1;3662:40:0;;;;;576:18:1;;3662:56:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;3545:181;;:::o;14:173:1:-;82:20;;-1:-1:-1;;;;;131:31:1;;121:42;;111:70;;177:1;174;167:12;111:70;14:173;;;:::o;192:260::-;260:6;268;321:2;309:9;300:7;296:23;292:32;289:52;;;337:1;334;327:12;289:52;360:29;379:9;360:29;:::i;:::-;350:39;;408:38;442:2;431:9;427:18;408:38;:::i;:::-;398:48;;192:260;;;;;:::o;847:186::-;906:6;959:2;947:9;938:7;934:23;930:32;927:52;;;975:1;972;965:12;927:52;998:29;1017:9;998:29;:::i;:::-;988:39;847:186;-1:-1:-1;;;847:186:1:o;1230:180::-;1289:6;1342:2;1330:9;1321:7;1317:23;1313:32;1310:52;;;1358:1;1355;1348:12;1310:52;-1:-1:-1;1381:23:1;;1230:180;-1:-1:-1;1230:180:1:o;1415:254::-;1483:6;1491;1544:2;1532:9;1523:7;1519:23;1515:32;1512:52;;;1560:1;1557;1550:12;1512:52;1583:29;1602:9;1583:29;:::i;:::-;1573:39;1659:2;1644:18;;;;1631:32;;-1:-1:-1;;;1415:254:1:o;2867:222::-;2932:9;;;2953:10;;;2950:133;;;3005:10;3000:3;2996:20;2993:1;2986:31;3040:4;3037:1;3030:15;3068:4;3065:1;3058:15

Swarm Source

ipfs://65ad5ddd0a09f6e3b64901a632698a2f6ebfbbf95f99a263fb64a5939ae4d51f

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.