Cryo Explorer Ethereum Mainnet

Address Contract Partially Verified

Address 0xD9a0927345244F2c45511CFaA5bDD00db7a8decc
Balance 0 ETH
Nonce 1
Code Size 6902 bytes
Indexed Transactions 0
External Etherscan · Sourcify

Contract Bytecode

6902 bytes
0x6080604052600436106100c25760003560e01c806393d200e11161007f578063efcf936e11610059578063efcf936e14610238578063f16e307514610254578063f2fde38b1461027f578063f9bcfa15146102a8576100c2565b806393d200e1146101c8578063949c485b146101f3578063c3ce22ec1461020f576100c2565b806305421dec146100c75780630602a78914610104578063715018a61461012d5780638629d6a8146101445780638c8dc6b6146101605780638da5cb5b1461019d575b600080fd5b3480156100d357600080fd5b506100ee60048036038101906100e9919061159e565b6102d3565b6040516100fb919061180f565b60405180910390f35b34801561011057600080fd5b5061012b60048036038101906101269190611523565b6102eb565b005b34801561013957600080fd5b506101426103ab565b005b61015e600480360381019061015991906115f0565b610433565b005b34801561016c57600080fd5b5061018760048036038101906101829190611648565b6107a7565b6040516101949190611747565b60405180910390f35b3480156101a957600080fd5b506101b26107f5565b6040516101bf9190611747565b60405180910390f35b3480156101d457600080fd5b506101dd61081e565b6040516101ea9190611747565b60405180910390f35b61020d600480360381019061020891906115f0565b610844565b005b34801561021b57600080fd5b5061023660048036038101906102319190611523565b610c7c565b005b610252600480360381019061024d91906115f0565b610d3c565b005b34801561026057600080fd5b50610269611260565b6040516102769190611747565b60405180910390f35b34801561028b57600080fd5b506102a660048036038101906102a19190611523565b611286565b005b3480156102b457600080fd5b506102bd61137e565b6040516102ca9190611794565b60405180910390f35b60046020528060005260406000206000915090505481565b6102f36113a4565b73ffffffffffffffffffffffffffffffffffffffff166103116107f5565b73ffffffffffffffffffffffffffffffffffffffff1614610367576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161035e906117cf565b60405180910390fd5b80600260006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b6103b36113a4565b73ffffffffffffffffffffffffffffffffffffffff166103d16107f5565b73ffffffffffffffffffffffffffffffffffffffff1614610427576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161041e906117cf565b60405180910390fd5b61043160006113ac565b565b823373ffffffffffffffffffffffffffffffffffffffff16600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16636352211e836040518263ffffffff1660e01b81526004016104a6919061180f565b60206040518083038186803b1580156104be57600080fd5b505afa1580156104d2573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906104f6919061154c565b73ffffffffffffffffffffffffffffffffffffffff161461054c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610543906117ef565b60405180910390fd5b6000600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16636ef25c3a6040518163ffffffff1660e01b815260040160206040518083038186803b1580156105b657600080fd5b505afa1580156105ca573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906105ee91906115c7565b1180156106495750600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614155b156106b857600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc349081150290604051600060405180830381858888f193505050501580156106b6573d6000803e3d6000fd5b505b600083838101906106c99190611575565b905060056000868152602001908152602001600020819080600181540180825580915050600190039060005260206000200160009091909190916101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506004600086815260200190815260200160002060008154809291906107639061192b565b9190505550847f3776ac189fa2c8d3a4733e7397d93d333d542704c4fc0bdb77eea756207651b2826040516107989190611747565b60405180910390a25050505050565b600560205281600052604060002081815481106107c357600080fd5b906000526020600020016000915091509054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b823373ffffffffffffffffffffffffffffffffffffffff16600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16636352211e836040518263ffffffff1660e01b81526004016108b7919061180f565b60206040518083038186803b1580156108cf57600080fd5b505afa1580156108e3573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610907919061154c565b73ffffffffffffffffffffffffffffffffffffffff161461095d576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610954906117ef565b60405180910390fd5b6000600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16636ef25c3a6040518163ffffffff1660e01b815260040160206040518083038186803b1580156109c757600080fd5b505afa1580156109db573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109ff91906115c7565b118015610a5a5750600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614155b15610ac957600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc349081150290604051600060405180830381858888f19350505050158015610ac7573d6000803e3d6000fd5b505b6000600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166361b69abd600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1686866040518463ffffffff1660e01b8152600401610b4c93929190611762565b602060405180830381600087803b158015610b6657600080fd5b505af1158015610b7a573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b9e919061154c565b905060056000868152602001908152602001600020819080600181540180825580915050600190039060005260206000200160009091909190916101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600460008681526020019081526020016000206000815480929190610c389061192b565b9190505550847f3776ac189fa2c8d3a4733e7397d93d333d542704c4fc0bdb77eea756207651b282604051610c6d9190611747565b60405180910390a25050505050565b610c846113a4565b73ffffffffffffffffffffffffffffffffffffffff16610ca26107f5565b73ffffffffffffffffffffffffffffffffffffffff1614610cf8576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610cef906117cf565b60405180910390fd5b80600360006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b823373ffffffffffffffffffffffffffffffffffffffff16600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16636352211e836040518263ffffffff1660e01b8152600401610daf919061180f565b60206040518083038186803b158015610dc757600080fd5b505afa158015610ddb573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610dff919061154c565b73ffffffffffffffffffffffffffffffffffffffff1614610e55576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610e4c906117ef565b60405180910390fd5b6000600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16636ef25c3a6040518163ffffffff1660e01b815260040160206040518083038186803b158015610ebf57600080fd5b505afa158015610ed3573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ef791906115c7565b118015610f525750600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614155b15610fc157600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc349081150290604051600060405180830381858888f19350505050158015610fbf573d6000803e3d6000fd5b505b60008383810190610fd2919061159e565b90506000600560008781526020019081526020016000208281548110611021577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1690506005600087815260200190815260200160002060016005600089815260200190815260200160002080549050611084919061184c565b815481106110bb577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16600560008881526020019081526020016000208381548110611131577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b9060005260206000200160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600560008781526020019081526020016000208054806111c2577f4e487b7100000000000000000000000000000000000000000000000000000000600052603160045260246000fd5b6001900381819060005260206000200160006101000a81549073ffffffffffffffffffffffffffffffffffffffff0219169055905560046000878152602001908152602001600020600081548092919061121b90611901565b9190505550857f6df21889b6202fd995285f8fa1ba8a89b63fb772ad4b0323e242b6ea72957024826040516112509190611747565b60405180910390a2505050505050565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b61128e6113a4565b73ffffffffffffffffffffffffffffffffffffffff166112ac6107f5565b73ffffffffffffffffffffffffffffffffffffffff1614611302576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016112f9906117cf565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415611372576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611369906117af565b60405180910390fd5b61137b816113ac565b50565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600033905090565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050816000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508173ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a35050565b60008135905061147f81611a7b565b92915050565b60008151905061149481611a7b565b92915050565b6000813590506114a981611a92565b92915050565b60008083601f8401126114c157600080fd5b8235905067ffffffffffffffff8111156114da57600080fd5b6020830191508360018202830111156114f257600080fd5b9250929050565b60008135905061150881611aa9565b92915050565b60008151905061151d81611aa9565b92915050565b60006020828403121561153557600080fd5b600061154384828501611470565b91505092915050565b60006020828403121561155e57600080fd5b600061156c84828501611485565b91505092915050565b60006020828403121561158757600080fd5b60006115958482850161149a565b91505092915050565b6000602082840312156115b057600080fd5b60006115be848285016114f9565b91505092915050565b6000602082840312156115d957600080fd5b60006115e78482850161150e565b91505092915050565b60008060006040848603121561160557600080fd5b6000611613868287016114f9565b935050602084013567ffffffffffffffff81111561163057600080fd5b61163c868287016114af565b92509250509250925092565b6000806040838503121561165b57600080fd5b6000611669858286016114f9565b925050602061167a858286016114f9565b9150509250929050565b61168d81611880565b82525050565b600061169f838561182a565b93506116ac8385846118f2565b6116b5836119a3565b840190509392505050565b6116c9816118ce565b82525050565b60006116dc60268361183b565b91506116e7826119b4565b604082019050919050565b60006116ff60208361183b565b915061170a82611a03565b602082019050919050565b600061172260228361183b565b915061172d82611a2c565b604082019050919050565b611741816118c4565b82525050565b600060208201905061175c6000830184611684565b92915050565b60006040820190506117776000830186611684565b818103602083015261178a818486611693565b9050949350505050565b60006020820190506117a960008301846116c0565b92915050565b600060208201905081810360008301526117c8816116cf565b9050919050565b600060208201905081810360008301526117e8816116f2565b9050919050565b6000602082019050818103600083015261180881611715565b9050919050565b60006020820190506118246000830184611738565b92915050565b600082825260208201905092915050565b600082825260208201905092915050565b6000611857826118c4565b9150611862836118c4565b92508282101561187557611874611974565b5b828203905092915050565b600061188b826118a4565b9050919050565b600061189d826118a4565b9050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b60006118d9826118e0565b9050919050565b60006118eb826118a4565b9050919050565b82818337600083830152505050565b600061190c826118c4565b915060008214156119205761191f611974565b5b600182039050919050565b6000611936826118c4565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff82141561196957611968611974565b5b600182019050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b6000601f19601f8301169050919050565b7f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160008201527f6464726573730000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f4f746f436f506c7567696e3a204e6f742074686520656e74697479206f776e6560008201527f722e000000000000000000000000000000000000000000000000000000000000602082015250565b611a8481611880565b8114611a8f57600080fd5b50565b611a9b81611892565b8114611aa657600080fd5b50565b611ab2816118c4565b8114611abd57600080fd5b5056fea2646970667358221220eb577510117fdd373d95420f9559712156ca8f32ec666b740f13aa69fcb2db4b64736f6c63430008030033

Verified Source Code Partial Match

Compiler: v0.8.3+commit.8d00100c EVM: istanbul Optimization: No
Multisig.sol 474 lines
// Sources flattened with hardhat v2.9.3 https://hardhat.org

// File @openzeppelin/contracts/utils/introspection/[email protected]

// SPDX-License-Identifier: UNLICENSED
// OpenZeppelin Contracts v4.4.1 (utils/introspection/IERC165.sol)

pragma solidity ^0.8.0;

/**
 * @dev Interface of the ERC165 standard, as defined in the
 * https://eips.ethereum.org/EIPS/eip-165[EIP].
 *
 * Implementers can declare support of contract interfaces, which can then be
 * queried by others ({ERC165Checker}).
 *
 * For an implementation, see {ERC165}.
 */
interface IERC165 {
    /**
     * @dev Returns true if this contract implements the interface defined by
     * `interfaceId`. See the corresponding
     * https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[EIP section]
     * to learn more about how these ids are created.
     *
     * This function call must use less than 30 000 gas.
     */
    function supportsInterface(bytes4 interfaceId) external view returns (bool);
}


// File @openzeppelin/contracts/token/ERC721/[email protected]
// OpenZeppelin Contracts v4.4.1 (token/ERC721/IERC721.sol)

pragma solidity ^0.8.0;

/**
 * @dev Required interface of an ERC721 compliant contract.
 */
interface IERC721 is IERC165 {
    /**
     * @dev Emitted when `tokenId` token is transferred from `from` to `to`.
     */
    event Transfer(address indexed from, address indexed to, uint256 indexed tokenId);

    /**
     * @dev Emitted when `owner` enables `approved` to manage the `tokenId` token.
     */
    event Approval(address indexed owner, address indexed approved, uint256 indexed tokenId);

    /**
     * @dev Emitted when `owner` enables or disables (`approved`) `operator` to manage all of its assets.
     */
    event ApprovalForAll(address indexed owner, address indexed operator, bool approved);

    /**
     * @dev Returns the number of tokens in ``owner``'s account.
     */
    function balanceOf(address owner) external view returns (uint256 balance);

    /**
     * @dev Returns the owner of the `tokenId` token.
     *
     * Requirements:
     *
     * - `tokenId` must exist.
     */
    function ownerOf(uint256 tokenId) external view returns (address owner);

    /**
     * @dev Safely transfers `tokenId` token from `from` to `to`, checking first that contract recipients
     * are aware of the ERC721 protocol to prevent tokens from being forever locked.
     *
     * Requirements:
     *
     * - `from` cannot be the zero address.
     * - `to` cannot be the zero address.
     * - `tokenId` token must exist and be owned by `from`.
     * - If the caller is not `from`, it must be have been allowed to move this token by either {approve} or {setApprovalForAll}.
     * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer.
     *
     * Emits a {Transfer} event.
     */
    function safeTransferFrom(
        address from,
        address to,
        uint256 tokenId
    ) external;

    /**
     * @dev Transfers `tokenId` token from `from` to `to`.
     *
     * WARNING: Usage of this method is discouraged, use {safeTransferFrom} whenever possible.
     *
     * Requirements:
     *
     * - `from` cannot be the zero address.
     * - `to` cannot be the zero address.
     * - `tokenId` token must be owned by `from`.
     * - If the caller is not `from`, it must be approved to move this token by either {approve} or {setApprovalForAll}.
     *
     * Emits a {Transfer} event.
     */
    function transferFrom(
        address from,
        address to,
        uint256 tokenId
    ) external;

    /**
     * @dev Gives permission to `to` to transfer `tokenId` token to another account.
     * The approval is cleared when the token is transferred.
     *
     * Only a single account can be approved at a time, so approving the zero address clears previous approvals.
     *
     * Requirements:
     *
     * - The caller must own the token or be an approved operator.
     * - `tokenId` must exist.
     *
     * Emits an {Approval} event.
     */
    function approve(address to, uint256 tokenId) external;

    /**
     * @dev Returns the account approved for `tokenId` token.
     *
     * Requirements:
     *
     * - `tokenId` must exist.
     */
    function getApproved(uint256 tokenId) external view returns (address operator);

    /**
     * @dev Approve or remove `operator` as an operator for the caller.
     * Operators can call {transferFrom} or {safeTransferFrom} for any token owned by the caller.
     *
     * Requirements:
     *
     * - The `operator` cannot be the caller.
     *
     * Emits an {ApprovalForAll} event.
     */
    function setApprovalForAll(address operator, bool _approved) external;

    /**
     * @dev Returns if the `operator` is allowed to manage all of the assets of `owner`.
     *
     * See {setApprovalForAll}
     */
    function isApprovedForAll(address owner, address operator) external view returns (bool);

    /**
     * @dev Safely transfers `tokenId` token from `from` to `to`.
     *
     * Requirements:
     *
     * - `from` cannot be the zero address.
     * - `to` cannot be the zero address.
     * - `tokenId` token must exist and be owned by `from`.
     * - If the caller is not `from`, it must be approved to move this token by either {approve} or {setApprovalForAll}.
     * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer.
     *
     * Emits a {Transfer} event.
     */
    function safeTransferFrom(
        address from,
        address to,
        uint256 tokenId,
        bytes calldata data
    ) external;
}


// File contracts/utils/IOtoCoMaster.sol
pragma solidity ^0.8.0;

interface IOtoCoMaster {

    /**
     * @dev See {IERC721-ownerOf}.
     */
    function ownerOf(uint256 tokenId) external view returns (address owner);

    /**
     * @dev See {OtoCoMaster-baseFee}.
     */
    function baseFee() external view returns (uint256 fee);

    receive() external payable;
}


// File contracts/utils/IOtoCoPlugin.sol
pragma solidity ^0.8.0;

interface IOtoCoPlugin {

    /**
     * Plugin initializer with a fuinction template to be used.
     * @dev To decode initialization data use i.e.: (string memory name) = abi.decode(pluginData, (string));
     *
     * @param pluginData The parameters to create a new instance of plugin.
     */
    function addPlugin(uint256 seriesId, bytes calldata pluginData) external payable;

    /**
     * Allow attach a previously deployed plugin if possible
     * @dev This function should run enumerous amounts of verifications before allow the attachment.
     * @dev To decode initialization data use i.e.: (string memory name) = abi.decode(pluginData, (string));
     *
     * @param pluginData The parameters to remove a instance of the plugin.
     */
    function attachPlugin(uint256 seriesId, bytes calldata pluginData) external payable;

    /**
     * Plugin initializer with a fuinction template to be used.
     * @dev To decode initialization data use i.e.: (string memory name) = abi.decode(pluginData, (string));
     *
     * @param pluginData The parameters to remove a instance of the plugin.
     */
    function removePlugin(uint256 seriesId, bytes calldata pluginData) external payable;
}


// File @openzeppelin/contracts/utils/[email protected]
// OpenZeppelin Contracts v4.4.1 (utils/Context.sol)

pragma solidity ^0.8.0;

/**
 * @dev Provides information about the current execution context, including the
 * sender of the transaction and its data. While these are generally available
 * via msg.sender and msg.data, they should not be accessed in such a direct
 * manner, since when dealing with meta-transactions the account sending and
 * paying for execution may not be the actual sender (as far as an application
 * is concerned).
 *
 * This contract is only required for intermediate, library-like contracts.
 */
abstract contract Context {
    function _msgSender() internal view virtual returns (address) {
        return msg.sender;
    }

    function _msgData() internal view virtual returns (bytes calldata) {
        return msg.data;
    }
}


// File @openzeppelin/contracts/access/[email protected]
// OpenZeppelin Contracts v4.4.1 (access/Ownable.sol)

pragma solidity ^0.8.0;

/**
 * @dev Contract module which provides a basic access control mechanism, where
 * there is an account (an owner) that can be granted exclusive access to
 * specific functions.
 *
 * By default, the owner account will be the one that deploys the contract. This
 * can later be changed with {transferOwnership}.
 *
 * This module is used through inheritance. It will make available the modifier
 * `onlyOwner`, which can be applied to your functions to restrict their use to
 * the owner.
 */
abstract contract Ownable is Context {
    address private _owner;

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

    /**
     * @dev Initializes the contract setting the deployer as the initial owner.
     */
    constructor() {
        _transferOwnership(_msgSender());
    }

    /**
     * @dev Returns the address of the current owner.
     */
    function owner() public view virtual returns (address) {
        return _owner;
    }

    /**
     * @dev Throws if called by any account other than the owner.
     */
    modifier onlyOwner() {
        require(owner() == _msgSender(), "Ownable: caller is not the owner");
        _;
    }

    /**
     * @dev Leaves the contract without owner. It will not be possible to call
     * `onlyOwner` functions anymore. Can only be called by the current owner.
     *
     * NOTE: Renouncing ownership will leave the contract without an owner,
     * thereby removing any functionality that is only available to the owner.
     */
    function renounceOwnership() public virtual onlyOwner {
        _transferOwnership(address(0));
    }

    /**
     * @dev Transfers ownership of the contract to a new account (`newOwner`).
     * Can only be called by the current owner.
     */
    function transferOwnership(address newOwner) public virtual onlyOwner {
        require(newOwner != address(0), "Ownable: new owner is the zero address");
        _transferOwnership(newOwner);
    }

    /**
     * @dev Transfers ownership of the contract to a new account (`newOwner`).
     * Internal function without access restriction.
     */
    function _transferOwnership(address newOwner) internal virtual {
        address oldOwner = _owner;
        _owner = newOwner;
        emit OwnershipTransferred(oldOwner, newOwner);
    }
}


// File contracts/OtoCoPlugin.sol
pragma solidity ^0.8.0;



abstract contract OtoCoPlugin is IOtoCoPlugin, Ownable {

    // Reference to the OtoCo Master to transfer plugin cost
    IOtoCoMaster public otocoMaster;

    /**
     * Modifier to allow only series owners to change content.
     * @param tokenId The plugin index to update.
     */
    modifier onlySeriesOwner(uint256 tokenId) {
        require(otocoMaster.ownerOf(tokenId) == msg.sender, "OtoCoPlugin: Not the entity owner.");
        _;
    }

    /**
     * Modifier to check if the function set the correct amount of ETH value and transfer it to master.
     * If baseFee are 0 or sender is OtoCoMaster this step is jumped.
     * @dev in the future add/attact/remove could be called from OtoCo Master. In those cases no transfer should be called.
     */
    modifier transferFees() {
        if (otocoMaster.baseFee() > 0 && msg.sender != address(otocoMaster)) payable(otocoMaster).transfer(msg.value);
        _;
    }

    constructor(address payable _otocoMaster) Ownable() {
        otocoMaster = IOtoCoMaster(_otocoMaster);
    }

    /**
     * Plugin initializer with a fuinction template to be used.
     * @dev To decode initialization data use i.e.: (string memory name) = abi.decode(pluginData, (string));
     * @dev Override this function to implement your elements.
     * @param pluginData The parameters to create a new instance of plugin.
     */
    function addPlugin(uint256 seriesId, bytes calldata pluginData) external payable virtual override;

    /**
     * Allow attach a previously deployed plugin if possible
     * @dev This function should run enumerous amounts of verifications before allow the attachment.
     * @dev To decode initialization data use i.e.: (string memory name) = abi.decode(pluginData, (string));
     * @dev Override this function to implement your elements.
     * @param pluginData The parameters to remove a instance of the plugin.
     */
    function attachPlugin(uint256 seriesId, bytes calldata pluginData) external payable virtual override {
        revert("OtoCoPlugin: Attach elements are not possible on this plugin.");
    }

    /**
     * Plugin initializer with a fuinction template to be used.
     * @dev To decode initialization data use i.e.: (string memory name) = abi.decode(pluginData, (string));
     * @dev Override this function to implement your elements.
     * @param pluginData The parameters to remove a instance of the plugin.
     */
    function removePlugin(uint256 seriesId, bytes calldata pluginData) external payable virtual override {
        revert("OtoCoPlugin: Remove elements are not possible on this plugin.");
    }
}


// File contracts/plugins/Multisig.sol
pragma solidity ^0.8.0;


interface GnosisSafeProxyFactory {
    function createProxy(address singleton, bytes memory data) external returns (address proxy);
}

/**
 * Multisig
 */
contract Multisig is OtoCoPlugin {

    event MultisigAdded(uint256 indexed series, address multisig);
    event MultisigRemoved(uint256 indexed series, address multisig);

    address public gnosisMasterCopy;
    address public gnosisProxyFactory;

    mapping(uint256 => uint256) public multisigPerEntity;
    mapping(uint256 => address[]) public multisigDeployed;

    constructor(
        address payable otocoMaster,
        address masterCopy,
        address proxyFactory,
        uint256[] memory prevIds,
        address[] memory prevMultisig
    ) OtoCoPlugin(otocoMaster) {
        gnosisMasterCopy = masterCopy;
        gnosisProxyFactory = proxyFactory;
        for (uint i = 0; i < prevIds.length; i++ ) {
            multisigDeployed[prevIds[i]].push(prevMultisig[i]);
            multisigPerEntity[prevIds[i]]++;
            emit MultisigAdded(prevIds[i], prevMultisig[i]);
        }
    }

    function updateGnosisMasterCopy(address newAddress) public onlyOwner {
        gnosisMasterCopy = newAddress;
    }

    function updateGnosisProxyFactory(address newAddress) public onlyOwner {
        gnosisProxyFactory = newAddress;
    }

    function addPlugin(uint256 seriesId, bytes calldata pluginData) public onlySeriesOwner(seriesId) transferFees() payable override {
        address proxy = GnosisSafeProxyFactory(gnosisProxyFactory).createProxy(gnosisMasterCopy, pluginData);
        multisigDeployed[seriesId].push(proxy);
        multisigPerEntity[seriesId]++;
        emit MultisigAdded(seriesId, proxy);
    }

    /**
    * Attaching a pre-existing multisig to the entity
    * @dev seriesId Series to remove token from
    * @dev newMultisig Multisig address to be attached
    *
    * @param pluginData Encoded parameters to create a new token.
     */
    function attachPlugin(uint256 seriesId, bytes calldata pluginData) public onlySeriesOwner(seriesId) transferFees() payable override {
        (
            address newMultisig
        ) = abi.decode(pluginData, ( address));
        multisigDeployed[seriesId].push(newMultisig);
        multisigPerEntity[seriesId]++;
        emit MultisigAdded(seriesId, newMultisig);
    }

    function removePlugin(uint256 seriesId, bytes calldata pluginData) public onlySeriesOwner(seriesId) transferFees() payable override {
        (
            uint256 toRemove
        ) = abi.decode(pluginData, (uint256));
        address multisigRemoved = multisigDeployed[seriesId][toRemove];
        // Copy last token to the removed slot
        multisigDeployed[seriesId][toRemove] = multisigDeployed[seriesId][multisigDeployed[seriesId].length - 1];
        // Remove the last token from array
        multisigDeployed[seriesId].pop();
        multisigPerEntity[seriesId]--;
        emit MultisigRemoved(seriesId, multisigRemoved);
    }

}

Read Contract

gnosisMasterCopy 0x93d200e1 → address
gnosisProxyFactory 0xf16e3075 → address
multisigDeployed 0x8c8dc6b6 → address
multisigPerEntity 0x05421dec → uint256
otocoMaster 0xf9bcfa15 → address
owner 0x8da5cb5b → address

Write Contract 7 functions

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

addPlugin 0x949c485b
uint256 seriesId
bytes pluginData
attachPlugin 0x8629d6a8
uint256 seriesId
bytes pluginData
removePlugin 0xefcf936e
uint256 seriesId
bytes pluginData
renounceOwnership 0x715018a6
No parameters
transferOwnership 0xf2fde38b
address newOwner
updateGnosisMasterCopy 0x0602a789
address newAddress
updateGnosisProxyFactory 0xc3ce22ec
address newAddress

Recent Transactions

No transactions found for this address