Cryo Explorer Ethereum Mainnet

Address Contract Partially Verified

Address 0xDE08aEf2b221274231b3547491ec8f0Fc80917e1
Balance 0 ETH
Nonce 1
Code Size 3947 bytes
Indexed Transactions 0
External Etherscan · Sourcify

Contract Bytecode

3947 bytes
0x608060405234801561001057600080fd5b50600436106100cf5760003560e01c8063a69beaba1161008c578063dcb0578d11610066578063dcb0578d1461024e578063dd46706414610271578063ed0813291461028e578063ffd864d314610331576100cf565b8063a69beaba1461020c578063c89e436114610229578063d8ccd0f314610231576100cf565b806311fa447b146100d457806312d43a511461019857806326476204146101bc5780634665096d146101f457806354717496146101fc578063a2fca6b314610204575b600080fd5b610196600480360360408110156100ea57600080fd5b81019060208101813564010000000081111561010557600080fd5b82018360208201111561011757600080fd5b8035906020019184602083028401116401000000008311171561013957600080fd5b91939092909160208101903564010000000081111561015757600080fd5b82018360208201111561016957600080fd5b8035906020019184602083028401116401000000008311171561018b57600080fd5b509092509050610339565b005b6101a06104e5565b604080516001600160a01b039092168252519081900360200190f35b6101e2600480360360208110156101d257600080fd5b50356001600160a01b0316610509565b60408051918252519081900360200190f35b6101e261051b565b6101a061053f565b6101a0610563565b6101966004803603602081101561022257600080fd5b5035610587565b6101a06106d1565b6101966004803603602081101561024757600080fd5b50356106f5565b6101966004803603604081101561026457600080fd5b508035906020013561092f565b6101966004803603602081101561028757600080fd5b5035610a82565b6101e2600480360360208110156102a457600080fd5b8101906020810181356401000000008111156102bf57600080fd5b8201836020820111156102d157600080fd5b803590602001918460208302840111640100000000831117156102f357600080fd5b919080806020026020016040519081016040528093929190818152602001838360200280828437600092019190915250929550610ccd945050505050565b6101a0610e6b565b336001600160a01b037f00000000000000000000000037d58532a985c2ad7a84ec61b0413cc4b2c4897716146103a4576040805162461bcd60e51b81526020600482018190526024820152600080516020610f16833981519152604482015290519081900360640190fd5b7f0000000000000000000000000000000000000000000000000000000067eaa1cb42106104025760405162461bcd60e51b8152600401808060200182810382526028815260200180610eee6028913960400191505060405180910390fd5b7f000000000000000000000000d3a9fe267852281a1e6307a1c37cdfd76d39b1336001600160a01b0316638733ece7858585856040518563ffffffff1660e01b81526004018080602001806020018381038352878782818152602001925060200280828437600083820152601f01601f19169091018481038352858152602090810191508690860280828437600081840152601f19601f8201169050808301925050509650505050505050600060405180830381600087803b1580156104c757600080fd5b505af11580156104db573d6000803e3d6000fd5b5050505050505050565b7f0000000000000000000000009f8f72aa9304c8b593d555f12ef6589cc3a579a281565b60006020819052908152604090205481565b7f0000000000000000000000000000000000000000000000000000000067eaa1cb81565b7f000000000000000000000000d3a9fe267852281a1e6307a1c37cdfd76d39b13381565b7f000000000000000000000000a618e54de493ec29432ebd2ca7f14efbf6ac17f781565b336001600160a01b037f00000000000000000000000037d58532a985c2ad7a84ec61b0413cc4b2c4897716146105f2576040805162461bcd60e51b81526020600482018190526024820152600080516020610f16833981519152604482015290519081900360640190fd5b7f0000000000000000000000000000000000000000000000000000000067eaa1cb42106106505760405162461bcd60e51b8152600401808060200182810382526028815260200180610eee6028913960400191505060405180910390fd5b7f0000000000000000000000000a3f6849f78076aefadf113f5bed87720274ddc06001600160a01b031663a69beaba826040518263ffffffff1660e01b815260040180828152602001915050600060405180830381600087803b1580156106b657600080fd5b505af11580156106ca573d6000803e3d6000fd5b5050505050565b7f00000000000000000000000037d58532a985c2ad7a84ec61b0413cc4b2c4897781565b33600090815260208190526040902054811115610759576040805162461bcd60e51b815260206004820152601f60248201527f566f746544656c65676174652f696e73756666696369656e742d7374616b6500604482015290519081900360640190fd5b3360008181526020819052604080822080548590039055805163f2d5d56b60e01b8152600481019390935260248301849052517f000000000000000000000000a618e54de493ec29432ebd2ca7f14efbf6ac17f76001600160a01b03169263f2d5d56b92604480830193919282900301818387803b1580156107da57600080fd5b505af11580156107ee573d6000803e3d6000fd5b505050507f0000000000000000000000000a3f6849f78076aefadf113f5bed87720274ddc06001600160a01b031663d8ccd0f3826040518263ffffffff1660e01b815260040180828152602001915050600060405180830381600087803b15801561085857600080fd5b505af115801561086c573d6000803e3d6000fd5b505060408051632dd4ea6360e21b81523360048201526024810185905290516001600160a01b037f0000000000000000000000009f8f72aa9304c8b593d555f12ef6589cc3a579a216935063b753a98c9250604480830192600092919082900301818387803b1580156108de57600080fd5b505af11580156108f2573d6000803e3d6000fd5b50506040805184815290513393507fce6c5af8fd109993cb40da4d5dc9e4dd8e61bc2e48f1e3901472141e4f56f29392509081900360200190a250565b336001600160a01b037f00000000000000000000000037d58532a985c2ad7a84ec61b0413cc4b2c48977161461099a576040805162461bcd60e51b81526020600482018190526024820152600080516020610f16833981519152604482015290519081900360640190fd5b7f0000000000000000000000000000000000000000000000000000000067eaa1cb42106109f85760405162461bcd60e51b8152600401808060200182810382526028815260200180610eee6028913960400191505060405180910390fd5b7f000000000000000000000000d3a9fe267852281a1e6307a1c37cdfd76d39b1336001600160a01b031663b384abef83836040518363ffffffff1660e01b81526004018083815260200182815260200192505050600060405180830381600087803b158015610a6657600080fd5b505af1158015610a7a573d6000803e3d6000fd5b505050505050565b7f0000000000000000000000000000000000000000000000000000000067eaa1cb4210610ae05760405162461bcd60e51b8152600401808060200182810382526028815260200180610eee6028913960400191505060405180910390fd5b33600090815260208190526040902054610afa9082610e8f565b3360008181526020819052604080822093909355825163f2d5d56b60e01b815260048101929092526024820184905291517f0000000000000000000000009f8f72aa9304c8b593d555f12ef6589cc3a579a26001600160a01b03169263f2d5d56b926044808201939182900301818387803b158015610b7857600080fd5b505af1158015610b8c573d6000803e3d6000fd5b505050507f0000000000000000000000000a3f6849f78076aefadf113f5bed87720274ddc06001600160a01b031663dd467064826040518263ffffffff1660e01b815260040180828152602001915050600060405180830381600087803b158015610bf657600080fd5b505af1158015610c0a573d6000803e3d6000fd5b505060408051632dd4ea6360e21b81523360048201526024810185905290516001600160a01b037f000000000000000000000000a618e54de493ec29432ebd2ca7f14efbf6ac17f716935063b753a98c9250604480830192600092919082900301818387803b158015610c7c57600080fd5b505af1158015610c90573d6000803e3d6000fd5b50506040805184815290513393507f625fed9875dada8643f2418b838ae0bc78d9a148a18eee4ee1979ff0f3f5d42792509081900360200190a250565b6000336001600160a01b037f00000000000000000000000037d58532a985c2ad7a84ec61b0413cc4b2c489771614610d3a576040805162461bcd60e51b81526020600482018190526024820152600080516020610f16833981519152604482015290519081900360640190fd5b7f0000000000000000000000000000000000000000000000000000000067eaa1cb4210610d985760405162461bcd60e51b8152600401808060200182810382526028815260200180610eee6028913960400191505060405180910390fd5b60405163ed08132960e01b81526020600482018181528451602484015284516001600160a01b037f0000000000000000000000000a3f6849f78076aefadf113f5bed87720274ddc0169363ed08132993879392839260440191808601910280838360005b83811015610e14578181015183820152602001610dfc565b5050505090500192505050602060405180830381600087803b158015610e3957600080fd5b505af1158015610e4d573d6000803e3d6000fd5b505050506040513d6020811015610e6357600080fd5b505192915050565b7f0000000000000000000000000a3f6849f78076aefadf113f5bed87720274ddc081565b80820182811015610ee7576040805162461bcd60e51b815260206004820152601960248201527f566f746544656c65676174652f6164642d6f766572666c6f7700000000000000604482015290519081900360640190fd5b9291505056fe566f746544656c65676174652f64656c65676174696f6e2d636f6e74726163742d65787069726564566f746544656c65676174652f73656e6465722d6e6f742d64656c6567617465a264697066735822122050aec0f24081032eeea71f5eb8e1b14b320c7acf1fc482c4b3803efa91704fc964736f6c634300060c0033

Verified Source Code Partial Match

Compiler: v0.6.12+commit.27d51765 EVM: istanbul Optimization: Yes (200 runs)
VoteDelegate.sol 118 lines
// SPDX-License-Identifier: AGPL-3.0-or-later

// Copyright (C) 2021 Dai Foundation

// 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/>.

// VoteDelegate - delegate your vote
pragma solidity 0.6.12;

interface TokenLike {
    function approve(address, uint256) external returns (bool);
    function pull(address, uint256) external;
    function push(address, uint256) external;
}

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

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

contract VoteDelegate {
    mapping(address => uint256) public stake;
    address     public immutable delegate;
    TokenLike   public immutable gov;
    TokenLike   public immutable iou;
    ChiefLike   public immutable chief;
    PollingLike public immutable polling;
    uint256     public immutable expiration;

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

    constructor(address _chief, address _polling, address _delegate) public {
        chief = ChiefLike(_chief);
        polling = PollingLike(_polling);
        delegate = _delegate;
        expiration = block.timestamp + 365 days;

        TokenLike _gov = gov = ChiefLike(_chief).GOV();
        TokenLike _iou = iou = ChiefLike(_chief).IOU();

        _gov.approve(_chief, type(uint256).max);
        _iou.approve(_chief, type(uint256).max);
    }

    function add(uint256 x, uint256 y) internal pure returns (uint256 z) {
        require((z = x + y) >= x, "VoteDelegate/add-overflow");
    }

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

    modifier live() {
        require(block.timestamp < expiration, "VoteDelegate/delegation-contract-expired");
        _;
    }

    function lock(uint256 wad) external live {
        stake[msg.sender] = add(stake[msg.sender], wad);
        gov.pull(msg.sender, wad);
        chief.lock(wad);
        iou.push(msg.sender, wad);

        emit Lock(msg.sender, wad);
    }

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

        stake[msg.sender] -= wad;
        iou.pull(msg.sender, wad);
        chief.free(wad);
        gov.push(msg.sender, wad);

        emit Free(msg.sender, wad);
    }

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

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

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

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

Read Contract

chief 0xffd864d3 → address
delegate 0xc89e4361 → address
expiration 0x4665096d → uint256
gov 0x12d43a51 → address
iou 0xa2fca6b3 → address
polling 0x54717496 → address
stake 0x26476204 → uint256

Write Contract 6 functions

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

free 0xd8ccd0f3
uint256 wad
lock 0xdd467064
uint256 wad
vote 0xa69beaba
bytes32 slate
vote 0xed081329
address[] yays
returns: bytes32
votePoll 0x11fa447b
uint256[] pollIds
uint256[] optionIds
votePoll 0xdcb0578d
uint256 pollId
uint256 optionId

Recent Transactions

No transactions found for this address