ETH Price: $3,750.34 (-1.86%)
Gas: 18 Gwei

Contract

0x02242A0A909F97bE3D727ab189f19B1961D76BE2
 

Overview

ETH Balance

0 ETH

Eth Value

$0.00

Multichain Info

No addresses found
Transaction Hash
Method
Block
From
To
Value
0x60806040158702342022-10-31 19:49:23575 days ago1667245763IN
 Create: GovernanceRegistry
0 ETH0.010404118.61316825

View more zero value Internal Transactions in Advanced View mode

Advanced mode:
Loading...
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
GovernanceRegistry

Compiler Version
v0.8.9+commit.e5eed63a

Optimization Enabled:
No with 200 runs

Other Settings:
default evmVersion
File 1 of 3 : GovernanceRegistry.sol
// SPDX-License-Identifier: MIT
pragma solidity 0.8.9;

import "./interfaces/IGovernanceRegistry.sol";
import "./interfaces/IGovernance.sol";

/**
 * @title Kapital DAO Governance Registry
 * @author Playground Labs
 * @custom:security-contact [email protected]
 * @notice Holds the latest address of the Kapital DAO governance contract.
 * Changing {governance} is a method of updating the Kapital DAO governance
 * structure if needed.
 */
contract GovernanceRegistry is IGovernanceRegistry {
    address public governance; // address of latest governance contract
    address public appointedGovernance; // address of newly appointed governance contract

    /// @param initialGovernance Address of governance contract at deployment
    constructor(address initialGovernance) {
        require(initialGovernance != address(0), "Registry: Zero address");
        governance = initialGovernance;
    }

    /**
     * @dev Called by the latest governance contract to update to a new address
     * if needed.
     * @dev This will only take effect after {newGovernance} executes {confirmChanged}
     * to verify that the valid address was appointed as a {newGovernance}.
     * @dev New governance contract should implement {votingPeriod}, being used by {Vesting} and {Staking}.
     * @param newGovernance Address of the new governance contract
     */
    function changeGovernance(address newGovernance) external {
        require(msg.sender == governance, "Registry: Only governance");
        require(
            newGovernance != address(0) && newGovernance != governance,
            "Registry: Invalid new governance"
        );

        IGovernance _newGovernance = IGovernance(newGovernance);
        require(_newGovernance.votingPeriod() > 0, "Registry: Invalid voting period");

        appointedGovernance = newGovernance;
    }

    /**
     * @dev Called by the new governance contract to verify the account ownership.
     * This will finally update the governance contract address.
     */
    function confirmChanged() external {
        require(appointedGovernance != address(0), "Registry: Invalid appointed");
        require(appointedGovernance == msg.sender, "Registry: Only appointed");

        governance = appointedGovernance;
        appointedGovernance = address(0);
    }
}

File 3 of 3 : IGovernanceRegistry.sol
// SPDX-License-Identifier: MIT
pragma solidity 0.8.9;

/**
 * @title Interface for GovernanceRegistry
 * @author Playground Labs
 */
interface IGovernanceRegistry {
    function governance() external view returns (address);
}

File 4 of 3 : IGovernance.sol
// SPDX-License-Identifier: MIT
pragma solidity 0.8.9;

/**
 * @title Interface for Kapital DAO Governance
 * @author Playground Labs
 * @custom:security-contact [email protected]
 */
interface IGovernance {
    function votingPeriod() external view returns (uint256); // used when reporting voting weight to prevent double-voting

    struct Proposal {
        bytes32 paramsHash; // hash of proposal data
        uint56 time; // proposal timestamp
        uint96 yays; // votes for proposal
        uint96 nays; // votes against proposal
        bool executed; // to make sure a proposal is only executed once
        bool vetoed; // vetoed proposal cannot be executed or voted on 
    }

    event Propose(
        address indexed proposer,
        uint256 indexed proposalId,
        address[] targets,
        uint256[] values,
        bytes[] data
    );
    event Vote(
        address indexed voter,
        uint256 indexed proposalId,
        bool yay,
        uint256 votingWeight
    );
    event Execute(address indexed executor, uint256 indexed proposalId);
    event Veto(uint256 indexed proposalId);
}

Settings
{
  "optimizer": {
    "enabled": false,
    "runs": 200
  },
  "outputSelection": {
    "*": {
      "*": [
        "evm.bytecode",
        "evm.deployedBytecode",
        "devdoc",
        "userdoc",
        "metadata",
        "abi"
      ]
    }
  },
  "libraries": {}
}

Contract Security Audit

Contract ABI

[{"inputs":[{"internalType":"address","name":"initialGovernance","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[],"name":"appointedGovernance","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"newGovernance","type":"address"}],"name":"changeGovernance","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"confirmChanged","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"governance","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"}]

608060405234801561001057600080fd5b50604051610aa9380380610aa98339818101604052810190610032919061014b565b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614156100a2576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610099906101d5565b60405180910390fd5b806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550506101f5565b600080fd5b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000610118826100ed565b9050919050565b6101288161010d565b811461013357600080fd5b50565b6000815190506101458161011f565b92915050565b600060208284031215610161576101606100e8565b5b600061016f84828501610136565b91505092915050565b600082825260208201905092915050565b7f52656769737472793a205a65726f206164647265737300000000000000000000600082015250565b60006101bf601683610178565b91506101ca82610189565b602082019050919050565b600060208201905081810360008301526101ee816101b2565b9050919050565b6108a5806102046000396000f3fe608060405234801561001057600080fd5b506004361061004c5760003560e01c8063129df91b146100515780634af9f7ec1461006f5780635aa6e6751461007957806399572d6f14610097575b600080fd5b6100596100b3565b6040516100669190610566565b60405180910390f35b6100776100d9565b005b6100816102a1565b60405161008e9190610566565b60405180910390f35b6100b160048036038101906100ac91906105b2565b6102c5565b005b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600073ffffffffffffffffffffffffffffffffffffffff16600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16141561016b576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016101629061063c565b60405180910390fd5b3373ffffffffffffffffffffffffffffffffffffffff16600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146101fb576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016101f2906106a8565b60405180910390fd5b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff166000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506000600160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610353576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161034a90610714565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16141580156103dc575060008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614155b61041b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161041290610780565b60405180910390fd5b600081905060008173ffffffffffffffffffffffffffffffffffffffff166302a251a36040518163ffffffff1660e01b815260040160206040518083038186803b15801561046857600080fd5b505afa15801561047c573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906104a091906107d6565b116104e0576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016104d79061084f565b60405180910390fd5b81600160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055505050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b600061055082610525565b9050919050565b61056081610545565b82525050565b600060208201905061057b6000830184610557565b92915050565b600080fd5b61058f81610545565b811461059a57600080fd5b50565b6000813590506105ac81610586565b92915050565b6000602082840312156105c8576105c7610581565b5b60006105d68482850161059d565b91505092915050565b600082825260208201905092915050565b7f52656769737472793a20496e76616c6964206170706f696e7465640000000000600082015250565b6000610626601b836105df565b9150610631826105f0565b602082019050919050565b6000602082019050818103600083015261065581610619565b9050919050565b7f52656769737472793a204f6e6c79206170706f696e7465640000000000000000600082015250565b60006106926018836105df565b915061069d8261065c565b602082019050919050565b600060208201905081810360008301526106c181610685565b9050919050565b7f52656769737472793a204f6e6c7920676f7665726e616e636500000000000000600082015250565b60006106fe6019836105df565b9150610709826106c8565b602082019050919050565b6000602082019050818103600083015261072d816106f1565b9050919050565b7f52656769737472793a20496e76616c6964206e657720676f7665726e616e6365600082015250565b600061076a6020836105df565b915061077582610734565b602082019050919050565b600060208201905081810360008301526107998161075d565b9050919050565b6000819050919050565b6107b3816107a0565b81146107be57600080fd5b50565b6000815190506107d0816107aa565b92915050565b6000602082840312156107ec576107eb610581565b5b60006107fa848285016107c1565b91505092915050565b7f52656769737472793a20496e76616c696420766f74696e6720706572696f6400600082015250565b6000610839601f836105df565b915061084482610803565b602082019050919050565b600060208201905081810360008301526108688161082c565b905091905056fea2646970667358221220aab22ce69d7700546daefdadb01a28e4791bc849f86993b9f01de6b825f0f02464736f6c63430008090033000000000000000000000000bc450c9eced158c6bd1affa8d37153e278e63e68

Deployed Bytecode

0x608060405234801561001057600080fd5b506004361061004c5760003560e01c8063129df91b146100515780634af9f7ec1461006f5780635aa6e6751461007957806399572d6f14610097575b600080fd5b6100596100b3565b6040516100669190610566565b60405180910390f35b6100776100d9565b005b6100816102a1565b60405161008e9190610566565b60405180910390f35b6100b160048036038101906100ac91906105b2565b6102c5565b005b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600073ffffffffffffffffffffffffffffffffffffffff16600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16141561016b576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016101629061063c565b60405180910390fd5b3373ffffffffffffffffffffffffffffffffffffffff16600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146101fb576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016101f2906106a8565b60405180910390fd5b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff166000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506000600160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610353576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161034a90610714565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16141580156103dc575060008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614155b61041b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161041290610780565b60405180910390fd5b600081905060008173ffffffffffffffffffffffffffffffffffffffff166302a251a36040518163ffffffff1660e01b815260040160206040518083038186803b15801561046857600080fd5b505afa15801561047c573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906104a091906107d6565b116104e0576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016104d79061084f565b60405180910390fd5b81600160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055505050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b600061055082610525565b9050919050565b61056081610545565b82525050565b600060208201905061057b6000830184610557565b92915050565b600080fd5b61058f81610545565b811461059a57600080fd5b50565b6000813590506105ac81610586565b92915050565b6000602082840312156105c8576105c7610581565b5b60006105d68482850161059d565b91505092915050565b600082825260208201905092915050565b7f52656769737472793a20496e76616c6964206170706f696e7465640000000000600082015250565b6000610626601b836105df565b9150610631826105f0565b602082019050919050565b6000602082019050818103600083015261065581610619565b9050919050565b7f52656769737472793a204f6e6c79206170706f696e7465640000000000000000600082015250565b60006106926018836105df565b915061069d8261065c565b602082019050919050565b600060208201905081810360008301526106c181610685565b9050919050565b7f52656769737472793a204f6e6c7920676f7665726e616e636500000000000000600082015250565b60006106fe6019836105df565b9150610709826106c8565b602082019050919050565b6000602082019050818103600083015261072d816106f1565b9050919050565b7f52656769737472793a20496e76616c6964206e657720676f7665726e616e6365600082015250565b600061076a6020836105df565b915061077582610734565b602082019050919050565b600060208201905081810360008301526107998161075d565b9050919050565b6000819050919050565b6107b3816107a0565b81146107be57600080fd5b50565b6000815190506107d0816107aa565b92915050565b6000602082840312156107ec576107eb610581565b5b60006107fa848285016107c1565b91505092915050565b7f52656769737472793a20496e76616c696420766f74696e6720706572696f6400600082015250565b6000610839601f836105df565b915061084482610803565b602082019050919050565b600060208201905081810360008301526108688161082c565b905091905056fea2646970667358221220aab22ce69d7700546daefdadb01a28e4791bc849f86993b9f01de6b825f0f02464736f6c63430008090033

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

000000000000000000000000bc450c9eced158c6bd1affa8d37153e278e63e68

-----Decoded View---------------
Arg [0] : initialGovernance (address): 0xbc450C9EcED158c6bD1AFfA8D37153E278e63e68

-----Encoded View---------------
1 Constructor Arguments found :
Arg [0] : 000000000000000000000000bc450c9eced158c6bd1affa8d37153e278e63e68


Block Transaction Difficulty 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
Loading...
Loading
[ 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.