ETH Price: $2,214.00 (+3.51%)

Contract

0x1171B858777120a59a6cc8148eDda8982F187Cd8
 

Overview

ETH Balance

0 ETH

Eth Value

$0.00

Multichain Info

No addresses found
Transaction Hash
Method
Block
From
To

There are no matching entries

Please try again later

View more zero value Internal Transactions in Advanced View mode

Advanced mode:
Loading...
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
TributaryRegistry

Compiler Version
v0.8.6+commit.11564f7e

Optimization Enabled:
Yes with 2000 runs

Other Settings:
default evmVersion
File 1 of 5 : TributaryRegistry.sol
// SPDX-License-Identifier: GPL-3.0-or-later
pragma solidity 0.8.6;

import {ITributaryRegistry} from "../interface/ITributaryRegistry.sol";
import {Governable} from "../lib/Governable.sol";

/**
 * Allows a registrar contract to register a new proxy as a block
 * that directs Mirror Token distribution to a tributary.
 * Ensures that the tributary is an Mirror DAO, and that only a valid
 * "Mirror Economic Block" created by a registered registrar, can contribute ETH
 * to the treasury. Otherwise, anyone could send ETH to the treasury to mint Mirror tokens.
 * @author MirrorXYZ
 */
contract TributaryRegistry is Governable, ITributaryRegistry {
    // ============ Mutable Storage ============

    // E.g. crowdfund factory. Can register producer => tributary.
    mapping(address => bool) allowedRegistrar;
    // E.g. crowdfund proxy => Mirror DAO.
    mapping(address => address) public override producerToTributary;
    // E.g. auctions house. Can send funds and specify tributary directly.
    mapping(address => bool) public override singletonProducer;

    // ============ Modifiers ============

    modifier onlyRegistrar() {
        require(allowedRegistrar[msg.sender], "sender not registered");
        _;
    }

    constructor(address owner_) Governable(owner_) {}

    // ============ Configuration ============

    function addRegistrar(address registrar) public override onlyGovernance {
        allowedRegistrar[registrar] = true;
    }

    function removeRegistrar(address registrar) public override onlyGovernance {
        delete allowedRegistrar[registrar];
    }

    function addSingletonProducer(address producer)
        public
        override
        onlyGovernance
    {
        singletonProducer[producer] = true;
    }

    function removeSingletonProducer(address producer)
        public
        override
        onlyGovernance
    {
        delete singletonProducer[producer];
    }

    // ============ Tributary Configuration ============

    /**
     * Register a producer's (crowdfund, edition etc) tributary. Can only be called
     * by an allowed registrar.
     */
    function registerTributary(address producer, address tributary)
        public
        override
        onlyRegistrar
    {
        producerToTributary[producer] = tributary;
    }

    /**
     * Allows the current tributary to update to a new tributary.
     */
    function changeTributary(address producer, address newTributary)
        public
        override
        onlyRegistrar
    {
        // Check that the sender of the transaction is the current tributary.
        require(
            msg.sender == producerToTributary[producer],
            "only for current tributary"
        );

        // Allow the current tributary to update to a new tributary.
        producerToTributary[producer] = newTributary;
    }
}

File 2 of 5 : ITributaryRegistry.sol
// SPDX-License-Identifier: GPL-3.0-or-later
pragma solidity 0.8.6;

interface ITributaryRegistry {
    function addRegistrar(address registrar) external;

    function removeRegistrar(address registrar) external;

    function addSingletonProducer(address producer) external;

    function removeSingletonProducer(address producer) external;

    function registerTributary(address producer, address tributary) external;

    function producerToTributary(address producer)
        external
        returns (address tributary);

    function singletonProducer(address producer) external returns (bool);

    function changeTributary(address producer, address newTributary) external;
}

File 3 of 5 : Governable.sol
// SPDX-License-Identifier: GPL-3.0-or-later
pragma solidity 0.8.6;

import {Ownable} from "../lib/Ownable.sol";
import {IGovernable} from "../lib/interface/IGovernable.sol";

contract Governable is Ownable, IGovernable {
    // ============ Mutable Storage ============

    // Mirror governance contract.
    address public override governor;

    // ============ Modifiers ============

    modifier onlyGovernance() {
        require(isOwner() || isGovernor(), "caller is not governance");
        _;
    }

    modifier onlyGovernor() {
        require(isGovernor(), "caller is not governor");
        _;
    }

    // ============ Constructor ============

    constructor(address owner_) Ownable(owner_) {}

    // ============ Administration ============

    function changeGovernor(address governor_) public override onlyGovernance {
        governor = governor_;
    }

    // ============ Utility Functions ============

    function isGovernor() public view override returns (bool) {
        return msg.sender == governor;
    }
}

File 4 of 5 : Ownable.sol
// SPDX-License-Identifier: GPL-3.0-or-later
pragma solidity 0.8.6;

contract Ownable {
    address public owner;
    address private nextOwner;

    event OwnershipTransferred(
        address indexed previousOwner,
        address indexed newOwner
    );

    // modifiers

    modifier onlyOwner() {
        require(isOwner(), "caller is not the owner.");
        _;
    }

    modifier onlyNextOwner() {
        require(isNextOwner(), "current owner must set caller as next owner.");
        _;
    }

    /**
     * @dev Initialize contract by setting transaction submitter as initial owner.
     */
    constructor(address owner_) {
        owner = owner_;
        emit OwnershipTransferred(address(0), owner);
    }

    /**
     * @dev Initiate ownership transfer by setting nextOwner.
     */
    function transferOwnership(address nextOwner_) external onlyOwner {
        require(nextOwner_ != address(0), "Next owner is the zero address.");

        nextOwner = nextOwner_;
    }

    /**
     * @dev Cancel ownership transfer by deleting nextOwner.
     */
    function cancelOwnershipTransfer() external onlyOwner {
        delete nextOwner;
    }

    /**
     * @dev Accepts ownership transfer by setting owner.
     */
    function acceptOwnership() external onlyNextOwner {
        delete nextOwner;

        owner = msg.sender;

        emit OwnershipTransferred(owner, msg.sender);
    }

    /**
     * @dev Renounce ownership by setting owner to zero address.
     */
    function renounceOwnership() external onlyOwner {
        owner = address(0);

        emit OwnershipTransferred(owner, address(0));
    }

    /**
     * @dev Returns true if the caller is the current owner.
     */
    function isOwner() public view returns (bool) {
        return msg.sender == owner;
    }

    /**
     * @dev Returns true if the caller is the next owner.
     */
    function isNextOwner() public view returns (bool) {
        return msg.sender == nextOwner;
    }
}

File 5 of 5 : IGovernable.sol
// SPDX-License-Identifier: GPL-3.0-or-later
pragma solidity 0.8.6;

interface IGovernable {
    function changeGovernor(address governor_) external;

    function isGovernor() external view returns (bool);

    function governor() external view returns (address);
}

Settings
{
  "optimizer": {
    "enabled": true,
    "runs": 2000
  },
  "outputSelection": {
    "*": {
      "*": [
        "evm.bytecode",
        "evm.deployedBytecode",
        "abi"
      ]
    }
  },
  "libraries": {}
}

Contract Security Audit

Contract ABI

API
[{"inputs":[{"internalType":"address","name":"owner_","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"inputs":[],"name":"acceptOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"registrar","type":"address"}],"name":"addRegistrar","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"producer","type":"address"}],"name":"addSingletonProducer","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"cancelOwnershipTransfer","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"governor_","type":"address"}],"name":"changeGovernor","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"producer","type":"address"},{"internalType":"address","name":"newTributary","type":"address"}],"name":"changeTributary","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"governor","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"isGovernor","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"isNextOwner","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"isOwner","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":"","type":"address"}],"name":"producerToTributary","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"producer","type":"address"},{"internalType":"address","name":"tributary","type":"address"}],"name":"registerTributary","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"registrar","type":"address"}],"name":"removeRegistrar","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"producer","type":"address"}],"name":"removeSingletonProducer","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"singletonProducer","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"nextOwner_","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"}]

608060405234801561001057600080fd5b50604051610b43380380610b4383398101604081905261002f91610081565b600080546001600160a01b0319166001600160a01b038316908117825560405183928392917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908290a35050506100b1565b60006020828403121561009357600080fd5b81516001600160a01b03811681146100aa57600080fd5b9392505050565b610a83806100c06000396000f3fe608060405234801561001057600080fd5b50600436106101365760003560e01c8063a5751856116100b2578063c7af335211610081578063ec72c34911610066578063ec72c34914610288578063ed459df21461029b578063f2fde38b146102ae57600080fd5b8063c7af335214610262578063e4c0aaf41461027557600080fd5b8063a5751856146101f0578063ad0a44a114610219578063af92a6931461023c578063ba904eed1461024f57600080fd5b8063715018a61161010957806379ba5097116100ee57806379ba5097146101b65780638da5cb5b146101be5780638f32d59b146101d157600080fd5b8063715018a61461019b578063756385e1146101a357600080fd5b80630c340a241461013b57806323452b9c1461016b57806325af854a146101755780633d2a6f7714610188575b600080fd5b60025461014e906001600160a01b031681565b6040516001600160a01b0390911681526020015b60405180910390f35b6101736102c1565b005b610173610183366004610a1a565b61033f565b610173610196366004610a1a565b610442565b6101736104a1565b6101736101b13660046109f8565b610544565b6101736105d4565b60005461014e906001600160a01b031681565b6000546001600160a01b031633145b6040519015158152602001610162565b61014e6101fe3660046109f8565b6004602052600090815260409020546001600160a01b031681565b6101e06102273660046109f8565b60056020526000908152604090205460ff1681565b61017361024a3660046109f8565b6106a9565b61017361025d3660046109f8565b61073c565b6002546001600160a01b031633146101e0565b6101736102833660046109f8565b6107cc565b6101736102963660046109f8565b61086a565b6001546001600160a01b031633146101e0565b6101736102bc3660046109f8565b6108fd565b6000546001600160a01b031633146103205760405162461bcd60e51b815260206004820152601860248201527f63616c6c6572206973206e6f7420746865206f776e65722e000000000000000060448201526064015b60405180910390fd5b6001805473ffffffffffffffffffffffffffffffffffffffff19169055565b3360009081526003602052604090205460ff1661039e5760405162461bcd60e51b815260206004820152601560248201527f73656e646572206e6f74207265676973746572656400000000000000000000006044820152606401610317565b6001600160a01b038281166000908152600460205260409020541633146104075760405162461bcd60e51b815260206004820152601a60248201527f6f6e6c7920666f722063757272656e74207472696275746172790000000000006044820152606401610317565b6001600160a01b039182166000908152600460205260409020805473ffffffffffffffffffffffffffffffffffffffff191691909216179055565b3360009081526003602052604090205460ff166104075760405162461bcd60e51b815260206004820152601560248201527f73656e646572206e6f74207265676973746572656400000000000000000000006044820152606401610317565b6000546001600160a01b031633146104fb5760405162461bcd60e51b815260206004820152601860248201527f63616c6c6572206973206e6f7420746865206f776e65722e00000000000000006044820152606401610317565b6000805473ffffffffffffffffffffffffffffffffffffffff1916815560405181907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908290a3565b6000546001600160a01b031633148061056757506002546001600160a01b031633145b6105b35760405162461bcd60e51b815260206004820152601860248201527f63616c6c6572206973206e6f7420676f7665726e616e636500000000000000006044820152606401610317565b6001600160a01b03166000908152600560205260409020805460ff19169055565b6001546001600160a01b031633146106545760405162461bcd60e51b815260206004820152602c60248201527f63757272656e74206f776e6572206d757374207365742063616c6c657220617360448201527f206e657874206f776e65722e00000000000000000000000000000000000000006064820152608401610317565b6001805473ffffffffffffffffffffffffffffffffffffffff19908116909155600080543392168217815560405182917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3565b6000546001600160a01b03163314806106cc57506002546001600160a01b031633145b6107185760405162461bcd60e51b815260206004820152601860248201527f63616c6c6572206973206e6f7420676f7665726e616e636500000000000000006044820152606401610317565b6001600160a01b03166000908152600360205260409020805460ff19166001179055565b6000546001600160a01b031633148061075f57506002546001600160a01b031633145b6107ab5760405162461bcd60e51b815260206004820152601860248201527f63616c6c6572206973206e6f7420676f7665726e616e636500000000000000006044820152606401610317565b6001600160a01b03166000908152600360205260409020805460ff19169055565b6000546001600160a01b03163314806107ef57506002546001600160a01b031633145b61083b5760405162461bcd60e51b815260206004820152601860248201527f63616c6c6572206973206e6f7420676f7665726e616e636500000000000000006044820152606401610317565b6002805473ffffffffffffffffffffffffffffffffffffffff19166001600160a01b0392909216919091179055565b6000546001600160a01b031633148061088d57506002546001600160a01b031633145b6108d95760405162461bcd60e51b815260206004820152601860248201527f63616c6c6572206973206e6f7420676f7665726e616e636500000000000000006044820152606401610317565b6001600160a01b03166000908152600560205260409020805460ff19166001179055565b6000546001600160a01b031633146109575760405162461bcd60e51b815260206004820152601860248201527f63616c6c6572206973206e6f7420746865206f776e65722e00000000000000006044820152606401610317565b6001600160a01b0381166109ad5760405162461bcd60e51b815260206004820152601f60248201527f4e657874206f776e657220697320746865207a65726f20616464726573732e006044820152606401610317565b6001805473ffffffffffffffffffffffffffffffffffffffff19166001600160a01b0392909216919091179055565b80356001600160a01b03811681146109f357600080fd5b919050565b600060208284031215610a0a57600080fd5b610a13826109dc565b9392505050565b60008060408385031215610a2d57600080fd5b610a36836109dc565b9150610a44602084016109dc565b9050925092905056fea2646970667358221220d5db156a461e177013fa1da236d42678e45eec31b260dbbff4565eb810b35c2864736f6c634300080600330000000000000000000000002330ee705ffd040bb0cba8cb7734dfe00e7c4b57

Deployed Bytecode

0x608060405234801561001057600080fd5b50600436106101365760003560e01c8063a5751856116100b2578063c7af335211610081578063ec72c34911610066578063ec72c34914610288578063ed459df21461029b578063f2fde38b146102ae57600080fd5b8063c7af335214610262578063e4c0aaf41461027557600080fd5b8063a5751856146101f0578063ad0a44a114610219578063af92a6931461023c578063ba904eed1461024f57600080fd5b8063715018a61161010957806379ba5097116100ee57806379ba5097146101b65780638da5cb5b146101be5780638f32d59b146101d157600080fd5b8063715018a61461019b578063756385e1146101a357600080fd5b80630c340a241461013b57806323452b9c1461016b57806325af854a146101755780633d2a6f7714610188575b600080fd5b60025461014e906001600160a01b031681565b6040516001600160a01b0390911681526020015b60405180910390f35b6101736102c1565b005b610173610183366004610a1a565b61033f565b610173610196366004610a1a565b610442565b6101736104a1565b6101736101b13660046109f8565b610544565b6101736105d4565b60005461014e906001600160a01b031681565b6000546001600160a01b031633145b6040519015158152602001610162565b61014e6101fe3660046109f8565b6004602052600090815260409020546001600160a01b031681565b6101e06102273660046109f8565b60056020526000908152604090205460ff1681565b61017361024a3660046109f8565b6106a9565b61017361025d3660046109f8565b61073c565b6002546001600160a01b031633146101e0565b6101736102833660046109f8565b6107cc565b6101736102963660046109f8565b61086a565b6001546001600160a01b031633146101e0565b6101736102bc3660046109f8565b6108fd565b6000546001600160a01b031633146103205760405162461bcd60e51b815260206004820152601860248201527f63616c6c6572206973206e6f7420746865206f776e65722e000000000000000060448201526064015b60405180910390fd5b6001805473ffffffffffffffffffffffffffffffffffffffff19169055565b3360009081526003602052604090205460ff1661039e5760405162461bcd60e51b815260206004820152601560248201527f73656e646572206e6f74207265676973746572656400000000000000000000006044820152606401610317565b6001600160a01b038281166000908152600460205260409020541633146104075760405162461bcd60e51b815260206004820152601a60248201527f6f6e6c7920666f722063757272656e74207472696275746172790000000000006044820152606401610317565b6001600160a01b039182166000908152600460205260409020805473ffffffffffffffffffffffffffffffffffffffff191691909216179055565b3360009081526003602052604090205460ff166104075760405162461bcd60e51b815260206004820152601560248201527f73656e646572206e6f74207265676973746572656400000000000000000000006044820152606401610317565b6000546001600160a01b031633146104fb5760405162461bcd60e51b815260206004820152601860248201527f63616c6c6572206973206e6f7420746865206f776e65722e00000000000000006044820152606401610317565b6000805473ffffffffffffffffffffffffffffffffffffffff1916815560405181907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908290a3565b6000546001600160a01b031633148061056757506002546001600160a01b031633145b6105b35760405162461bcd60e51b815260206004820152601860248201527f63616c6c6572206973206e6f7420676f7665726e616e636500000000000000006044820152606401610317565b6001600160a01b03166000908152600560205260409020805460ff19169055565b6001546001600160a01b031633146106545760405162461bcd60e51b815260206004820152602c60248201527f63757272656e74206f776e6572206d757374207365742063616c6c657220617360448201527f206e657874206f776e65722e00000000000000000000000000000000000000006064820152608401610317565b6001805473ffffffffffffffffffffffffffffffffffffffff19908116909155600080543392168217815560405182917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3565b6000546001600160a01b03163314806106cc57506002546001600160a01b031633145b6107185760405162461bcd60e51b815260206004820152601860248201527f63616c6c6572206973206e6f7420676f7665726e616e636500000000000000006044820152606401610317565b6001600160a01b03166000908152600360205260409020805460ff19166001179055565b6000546001600160a01b031633148061075f57506002546001600160a01b031633145b6107ab5760405162461bcd60e51b815260206004820152601860248201527f63616c6c6572206973206e6f7420676f7665726e616e636500000000000000006044820152606401610317565b6001600160a01b03166000908152600360205260409020805460ff19169055565b6000546001600160a01b03163314806107ef57506002546001600160a01b031633145b61083b5760405162461bcd60e51b815260206004820152601860248201527f63616c6c6572206973206e6f7420676f7665726e616e636500000000000000006044820152606401610317565b6002805473ffffffffffffffffffffffffffffffffffffffff19166001600160a01b0392909216919091179055565b6000546001600160a01b031633148061088d57506002546001600160a01b031633145b6108d95760405162461bcd60e51b815260206004820152601860248201527f63616c6c6572206973206e6f7420676f7665726e616e636500000000000000006044820152606401610317565b6001600160a01b03166000908152600560205260409020805460ff19166001179055565b6000546001600160a01b031633146109575760405162461bcd60e51b815260206004820152601860248201527f63616c6c6572206973206e6f7420746865206f776e65722e00000000000000006044820152606401610317565b6001600160a01b0381166109ad5760405162461bcd60e51b815260206004820152601f60248201527f4e657874206f776e657220697320746865207a65726f20616464726573732e006044820152606401610317565b6001805473ffffffffffffffffffffffffffffffffffffffff19166001600160a01b0392909216919091179055565b80356001600160a01b03811681146109f357600080fd5b919050565b600060208284031215610a0a57600080fd5b610a13826109dc565b9392505050565b60008060408385031215610a2d57600080fd5b610a36836109dc565b9150610a44602084016109dc565b9050925092905056fea2646970667358221220d5db156a461e177013fa1da236d42678e45eec31b260dbbff4565eb810b35c2864736f6c63430008060033

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

0000000000000000000000002330ee705ffd040bb0cba8cb7734dfe00e7c4b57

-----Decoded View---------------
Arg [0] : owner_ (address): 0x2330ee705fFD040bB0cbA8CB7734Dfe00E7C4b57

-----Encoded View---------------
1 Constructor Arguments found :
Arg [0] : 0000000000000000000000002330ee705ffd040bb0cba8cb7734dfe00e7c4b57


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

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.