Cryo Explorer Ethereum Mainnet

Address Contract Partially Verified

Address 0x4Cf3DaeFA2683Cd18df00f7AFF5169C00a9EccD5
Balance 0 ETH
Nonce 67
Code Size 4153 bytes
Indexed Transactions 0
External Etherscan · Sourcify

Contract Bytecode

4153 bytes
0x608060405234801561000f575f80fd5b5060043610610060575f3560e01c8063077796271461006457806354717496146100a6578063587cde1e146100e5578063d42efd831461010d578063efc81a8c1461013a578063ffd864d314610142575b5f80fd5b6100916100723660046102e6565b6001600160a01b039081165f9081526020819052604090205416151590565b60405190151581526020015b60405180910390f35b6100cd7f000000000000000000000000d3a9fe267852281a1e6307a1c37cdfd76d39b13381565b6040516001600160a01b03909116815260200161009d565b6100cd6100f33660046102e6565b5f602081905290815260409020546001600160a01b031681565b61012c61011b3660046102e6565b60016020525f908152604090205481565b60405190815260200161009d565b6100cd610169565b6100cd7f000000000000000000000000929d9a1435662357f54adcf64dcee4d6b867a6f981565b335f908152602081905260408120546001600160a01b0316156101e95760405162461bcd60e51b815260206004820152602e60248201527f566f746544656c6567617465466163746f72792f73656e6465722d69732d616c60448201526d72656164792d64656c656761746560901b606482015260840160405180910390fd5b7f000000000000000000000000929d9a1435662357f54adcf64dcee4d6b867a6f97f000000000000000000000000d3a9fe267852281a1e6307a1c37cdfd76d39b13333604051610238906102d9565b6001600160a01b03938416815291831660208301529091166040820152606001604051809103905ff080158015610271573d5f803e3d5ffd5b50335f8181526020818152604080832080546001600160a01b0319166001600160a01b0387169081179091558084526001928390528184209290925551939450927f2187b96b95fffefab01016c852705bc8ec76d1ea17dd5bffef25fd71366336449190a390565b610cf08061031483390190565b5f602082840312156102f6575f80fd5b81356001600160a01b038116811461030c575f80fd5b939250505056fe610100604052348015610010575f80fd5b50604051610cf0380380610cf083398101604081905261002f9161012a565b6001600160a01b0380841660c081905283821660e052908216608052604080516312d43a5160e01b815290516312d43a51916004808201926020929091908290030181865afa158015610084573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906100a89190610174565b6001600160a01b0390811660a081905260405163095ea7b360e01b815291851660048301525f1960248301529063095ea7b3906044015f604051808303815f87803b1580156100f5575f80fd5b505af1158015610107573d5f803e3d5ffd5b50505050505050610196565b6001600160a01b0381168114610127575f80fd5b50565b5f805f6060848603121561013c575f80fd5b835161014781610113565b602085015190935061015881610113565b604085015190925061016981610113565b809150509250925092565b5f60208284031215610184575f80fd5b815161018f81610113565b9392505050565b60805160a05160c05160e051610ad461021c5f395f81816101350152818161026c015261059b01525f81816101e2015281816103380152818161042b0152818161069301526107aa01525f818160c40152818161049c015261062001525f818161016f0152818161020f015281816102e50152818161054101526107560152610ad45ff3fe608060405234801561000f575f80fd5b50600436106100a6575f3560e01c8063c89e43611161006e578063c89e43611461016a578063d8ccd0f314610191578063dcb0578d146101a4578063dd467064146101b7578063ed081329146101ca578063ffd864d3146101dd575f80fd5b806311fa447b146100aa57806312d43a51146100bf57806326476204146101035780635471749614610130578063a69beaba14610157575b5f80fd5b6100bd6100b8366004610870565b610204565b005b6100e67f000000000000000000000000000000000000000000000000000000000000000081565b6040516001600160a01b0390911681526020015b60405180910390f35b6101226101113660046108f2565b5f6020819052908152604090205481565b6040519081526020016100fa565b6100e67f000000000000000000000000000000000000000000000000000000000000000081565b6100bd61016536600461090b565b6102da565b6100e67f000000000000000000000000000000000000000000000000000000000000000081565b6100bd61019f36600461090b565b61039a565b6100bd6101b2366004610922565b610536565b6100bd6101c536600461090b565b6105fe565b6101226101d8366004610942565b61074a565b6100e67f000000000000000000000000000000000000000000000000000000000000000081565b336001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016146102555760405162461bcd60e51b815260040161024c90610981565b60405180910390fd5b604051638733ece760e01b81526001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001690638733ece7906102a79087908790879087906004016109e6565b5f604051808303815f87803b1580156102be575f80fd5b505af11580156102d0573d5f803e3d5ffd5b5050505050505050565b336001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016146103225760405162461bcd60e51b815260040161024c90610981565b60405163534df55d60e11b8152600481018290527f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03169063a69beaba906024015f604051808303815f87803b158015610381575f80fd5b505af1158015610393573d5f803e3d5ffd5b5050505050565b335f908152602081905260409020548111156103f85760405162461bcd60e51b815260206004820152601f60248201527f566f746544656c65676174652f696e73756666696369656e742d7374616b6500604482015260640161024c565b335f9081526020819052604090819020805483900390555163d8ccd0f360e01b8152600481018290526001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000169063d8ccd0f3906024015f604051808303815f87803b15801561046c575f80fd5b505af115801561047e573d5f803e3d5ffd5b505060405163a9059cbb60e01b8152336004820152602481018490527f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316925063a9059cbb91506044015f604051808303815f87803b1580156104e7575f80fd5b505af11580156104f9573d5f803e3d5ffd5b50506040518381523392507fce6c5af8fd109993cb40da4d5dc9e4dd8e61bc2e48f1e3901472141e4f56f29391506020015b60405180910390a250565b336001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000161461057e5760405162461bcd60e51b815260040161024c90610981565b60405163b384abef60e01b815260048101839052602481018290527f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03169063b384abef906044015f604051808303815f87803b1580156105e4575f80fd5b505af11580156105f6573d5f803e3d5ffd5b505050505050565b6040516323b872dd60e01b8152336004820152306024820152604481018290527f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316906323b872dd906064015f604051808303815f87803b158015610669575f80fd5b505af115801561067b573d5f803e3d5ffd5b50506040516337519c1960e21b8152600481018490527f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316925063dd46706491506024015f604051808303815f87803b1580156106de575f80fd5b505af11580156106f0573d5f803e3d5ffd5b5050335f9081526020819052604081208054859450909250610713908490610a17565b909155505060405181815233907f625fed9875dada8643f2418b838ae0bc78d9a148a18eee4ee1979ff0f3f5d4279060200161052b565b5f336001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016146107935760405162461bcd60e51b815260040161024c90610981565b60405163ed08132960e01b81526001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000169063ed081329906107e19086908690600401610a3c565b6020604051808303815f875af11580156107fd573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906108219190610a87565b9392505050565b5f8083601f840112610838575f80fd5b50813567ffffffffffffffff81111561084f575f80fd5b6020830191508360208260051b8501011115610869575f80fd5b9250929050565b5f805f8060408587031215610883575f80fd5b843567ffffffffffffffff8082111561089a575f80fd5b6108a688838901610828565b909650945060208701359150808211156108be575f80fd5b506108cb87828801610828565b95989497509550505050565b80356001600160a01b03811681146108ed575f80fd5b919050565b5f60208284031215610902575f80fd5b610821826108d7565b5f6020828403121561091b575f80fd5b5035919050565b5f8060408385031215610933575f80fd5b50508035926020909101359150565b5f8060208385031215610953575f80fd5b823567ffffffffffffffff811115610969575f80fd5b61097585828601610828565b90969095509350505050565b6020808252818101527f566f746544656c65676174652f73656e6465722d6e6f742d64656c6567617465604082015260600190565b8183525f6001600160fb1b038311156109cd575f80fd5b8260051b80836020870137939093016020019392505050565b604081525f6109f96040830186886109b6565b8281036020840152610a0c8185876109b6565b979650505050505050565b80820180821115610a3657634e487b7160e01b5f52601160045260245ffd5b92915050565b60208082528181018390525f908460408401835b86811015610a7c576001600160a01b03610a69846108d7565b1682529183019190830190600101610a50565b509695505050505050565b5f60208284031215610a97575f80fd5b505191905056fea26469706673582212208acb81abe60342ec0afa61a15a0d7ac3c8bd355fe8e955593c1e8b04576d666264736f6c63430008150033a2646970667358221220941547dbc651fd97ddf2f00bdf652993ecf94ccacc129017575ad80364fdca3d64736f6c63430008150033

Verified Source Code Partial Match

Compiler: v0.8.21+commit.d9974bed EVM: shanghai Optimization: Yes (200 runs)
VoteDelegateFactory.sol 56 lines
// SPDX-FileCopyrightText: © 2021 Dai Foundation <www.daifoundation.org>
// SPDX-License-Identifier: AGPL-3.0-or-later
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
// GNU Affero General Public License for more details.
//
// You should have received a copy of the GNU Affero General Public License
// along with this program.  If not, see <https://www.gnu.org/licenses/>.

pragma solidity ^0.8.21;

import {VoteDelegate} from "src/VoteDelegate.sol";

contract VoteDelegateFactory {
    // --- storage variables ---

    mapping(address usr => address voteDelegate)     public delegates;
    mapping(address voteDelegate => uint256 created) public created;

    // --- immutables ---

    address immutable public chief;
    address immutable public polling;

    // --- events ---

    event CreateVoteDelegate(address indexed usr, address indexed voteDelegate);

    // --- constructor ---

    constructor(address _chief, address _polling) {
        chief = _chief;
        polling = _polling;
    }

    function isDelegate(address usr) public view returns (bool ok) {
        ok = delegates[usr] != address(0);
    }

    function create() external returns (address voteDelegate) {
        require(!isDelegate(msg.sender), "VoteDelegateFactory/sender-is-already-delegate");

        voteDelegate = address(new VoteDelegate(chief, polling, msg.sender));
        delegates[msg.sender] = voteDelegate;
        created[voteDelegate] = 1;

        emit CreateVoteDelegate(msg.sender, voteDelegate);
    }
}
VoteDelegate.sol 111 lines
// SPDX-FileCopyrightText: © 2021 Dai Foundation <www.daifoundation.org>
// SPDX-License-Identifier: AGPL-3.0-or-later
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
// GNU Affero General Public License for more details.
//
// You should have received a copy of the GNU Affero General Public License
// along with this program.  If not, see <https://www.gnu.org/licenses/>.

pragma solidity ^0.8.21;

interface GemLike {
    function approve(address, uint256) external;
    function transfer(address, uint256) external;
    function transferFrom(address, address, uint256) external;
}

interface ChiefLike {
    function gov() external view returns (GemLike);
    function lock(uint256) external;
    function free(uint256) external;
    function vote(address[] calldata) external returns (bytes32);
    function vote(bytes32) external;
}

interface PollingLike {
    function vote(uint256, uint256) external;
    function vote(uint256[] calldata, uint256[] calldata) external;
}

contract VoteDelegate {
    // --- storage variables ---

    mapping(address => uint256) public stake;

    // --- immutables ---

    address     immutable public delegate;
    GemLike     immutable public gov;
    ChiefLike   immutable public chief;
    PollingLike immutable public polling;

    // --- events ---

    event Lock(address indexed usr, uint256 wad);
    event Free(address indexed usr, uint256 wad);

    // --- constructor ---

    constructor(address chief_, address polling_, address delegate_) {
        chief = ChiefLike(chief_);
        polling = PollingLike(polling_);
        delegate = delegate_;

        gov = ChiefLike(chief_).gov();
        gov.approve(chief_, type(uint256).max);
    }

    // --- modifiers ---

    modifier delegate_auth() {
        require(msg.sender == delegate, "VoteDelegate/sender-not-delegate");
        _;
    }

    // --- gov owner functions

    function lock(uint256 wad) external {
        gov.transferFrom(msg.sender, address(this), wad);
        chief.lock(wad);
        stake[msg.sender] += wad;

        emit Lock(msg.sender, wad);
    }

    function free(uint256 wad) external {
        require(stake[msg.sender] >= wad, "VoteDelegate/insufficient-stake");
        unchecked { stake[msg.sender] -= wad; }
        chief.free(wad);
        gov.transfer(msg.sender, wad);

        emit Free(msg.sender, wad);
    }

    // --- delegate executive voting functions

    function vote(address[] calldata yays) external delegate_auth returns (bytes32 result) {
        result = chief.vote(yays);
    }

    function vote(bytes32 slate) external delegate_auth {
        chief.vote(slate);
    }

    // --- delegate poll voting functions

    function votePoll(uint256 pollId, uint256 optionId) external delegate_auth {
        polling.vote(pollId, optionId);
    }

    function votePoll(uint256[] calldata pollIds, uint256[] calldata optionIds) external delegate_auth {
        polling.vote(pollIds, optionIds);
    }
}

Read Contract

chief 0xffd864d3 → address
created 0xd42efd83 → uint256
delegates 0x587cde1e → address
isDelegate 0x07779627 → bool
polling 0x54717496 → address

Write Contract 1 functions

These functions modify contract state and require a wallet transaction to execute.

create 0xefc81a8c
No parameters
returns: address

Recent Transactions

No transactions found for this address