ETH Price: $3,242.41 (-0.50%)
Gas: 1 Gwei

Contract

0xC4bc4f5b8c2f92C8451400961f7b07F394DB9A13
 

Overview

ETH Balance

0 ETH

Eth Value

$0.00

Multichain Info

No addresses found
Transaction Hash
Method
Block
From
To
0x60806040145603572022-04-10 21:26:46839 days ago1649626006IN
 Create: MartianMarketPriceController
0 ETH0.0129921143.32338232

Latest 25 internal transactions (View All)

Advanced mode:
Parent Transaction Hash Block From To
203628002024-07-22 14:55:115 days ago1721660111
0xC4bc4f5b...394DB9A13
0 ETH
203628002024-07-22 14:55:115 days ago1721660111
0xC4bc4f5b...394DB9A13
0 ETH
203627902024-07-22 14:53:115 days ago1721659991
0xC4bc4f5b...394DB9A13
0 ETH
203627902024-07-22 14:53:115 days ago1721659991
0xC4bc4f5b...394DB9A13
0 ETH
203388572024-07-19 6:42:598 days ago1721371379
0xC4bc4f5b...394DB9A13
0 ETH
203388572024-07-19 6:42:598 days ago1721371379
0xC4bc4f5b...394DB9A13
0 ETH
203374272024-07-19 1:55:479 days ago1721354147
0xC4bc4f5b...394DB9A13
0 ETH
203374272024-07-19 1:55:479 days ago1721354147
0xC4bc4f5b...394DB9A13
0 ETH
202229882024-07-03 2:25:5925 days ago1719973559
0xC4bc4f5b...394DB9A13
0 ETH
202229882024-07-03 2:25:5925 days ago1719973559
0xC4bc4f5b...394DB9A13
0 ETH
202223462024-07-03 0:16:4725 days ago1719965807
0xC4bc4f5b...394DB9A13
0 ETH
202223462024-07-03 0:16:4725 days ago1719965807
0xC4bc4f5b...394DB9A13
0 ETH
202220242024-07-02 23:11:4725 days ago1719961907
0xC4bc4f5b...394DB9A13
0 ETH
202220242024-07-02 23:11:4725 days ago1719961907
0xC4bc4f5b...394DB9A13
0 ETH
202220202024-07-02 23:10:5925 days ago1719961859
0xC4bc4f5b...394DB9A13
0 ETH
202220202024-07-02 23:10:5925 days ago1719961859
0xC4bc4f5b...394DB9A13
0 ETH
202215522024-07-02 21:36:4725 days ago1719956207
0xC4bc4f5b...394DB9A13
0 ETH
202215522024-07-02 21:36:4725 days ago1719956207
0xC4bc4f5b...394DB9A13
0 ETH
202215242024-07-02 21:31:1125 days ago1719955871
0xC4bc4f5b...394DB9A13
0 ETH
202215242024-07-02 21:31:1125 days ago1719955871
0xC4bc4f5b...394DB9A13
0 ETH
202214482024-07-02 21:15:5925 days ago1719954959
0xC4bc4f5b...394DB9A13
0 ETH
202214482024-07-02 21:15:5925 days ago1719954959
0xC4bc4f5b...394DB9A13
0 ETH
202208872024-07-02 19:22:3525 days ago1719948155
0xC4bc4f5b...394DB9A13
0 ETH
202208872024-07-02 19:22:3525 days ago1719948155
0xC4bc4f5b...394DB9A13
0 ETH
202207892024-07-02 19:02:4725 days ago1719946967
0xC4bc4f5b...394DB9A13
0 ETH
View All Internal Transactions
Loading...
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
MartianMarketPriceController

Compiler Version
v0.8.7+commit.e28d00a7

Optimization Enabled:
Yes with 200 runs

Other Settings:
default evmVersion, MIT license
/**
 *Submitted for verification at Etherscan.io on 2022-04-10
*/

//SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;


/////////////////////////////////////////////////////////////////////////
//     __  ___         __  _             __  ___         __       __   //
//    /  |/  /__ _____/ /_(_)__ ____    /  |/  /__ _____/ /_____ / /_  //
//   / /|_/ / _ `/ __/ __/ / _ `/ _ \  / /|_/ / _ `/ __/  '_/ -_) __/  //
//  /_/  /_/\_,_/_/  \__/_/\_,_/_//_/ /_/  /_/\_,_/_/ /_/\_\\__/\__/   //
//                                                by 0xInuarashi.eth   //
/////////////////////////////////////////////////////////////////////////

/*
    Martian Market by 0xInuarashi for Message to Martians (Martians)
    A Fully functioning on-chain CMS system that can be tapped into front-ends
    and create a responsive website based on contract-specific databases.

    ** THIS IS A DECENTRALIZED AND TRUSTLESS WHITELIST MARKETPLACE CREATION SYSTEM **

    We chose not to use a proxy contract as multiple approvals have to be done
    for this contract. In this case, we chose the most decentralized approach
    which is to create an immutable contract with minimal owner access and 
    allow full control of contract owners' functions over their own database, 
    which is not editable or tamperable even by the Ownable owner themself.

    >>>> Governance Model <<<<

        Ownable Owner 
            - Set Super Governor Address
            - Renounce Super Governor Address (1-way)
            - Set Governor Address
            - Set $MES Address 

        Super Governor
            - Enable / Disable Projects
            - Set Project Infos 
            - Unstuck Owners (On Super Governor Enabled Projects Only)

        Governor
            - Set Registry Price
            - Set Registry Treasury Address
            - Withdraw $MES from Contract

        Contract Owner
            - Register Their Contract with $MES
            - Set Project Info
            - Set Treasury Address
            - Set Contract Controllers
            - Add Items 
            - Modify Items
            - Remove Items

        Contract Controller
            - Add Items 
            - Modify Items
            - Remove Items

    >>>> Interfacing <<<<<

    To draw a front-end interface:
    
        getAllEnabledContracts() - Enumerate all available contracts for selection
        (for contract-specific front-end interfaces, just pull data from your 
        contract only)
    
        getWLVendingItemsAll(address contract_) - Enumerate all vending items
        available for the contract. Supports over 1000 items in 1 call but
        if you get gas errors, use a pagination method instead.

        Pagination method: 
        getWLVendingItemsPaginated(address contract_, uint256 start_, uint256 end_)
        for the start_, generally you can use 0, and for end_, inquire from function
        getWLVendingItemsLength(address contract_)

    For interaction of users:

        purchaseWLVendingItem(address contract_, uint256 index_) can be used
        and automatically populated to the correct buttons for each WLVendingItem
        for that, an ethers.js call is invoked for the user to call the function
        which will transfer their ERC20 token and add them to the purchasers list

    For administration:

        setTreasuryAddress(address contract_, address treasury_) can only be set
        by the contract owner. For this, they are able to set where the ERC20 tokens
        from the whitelist marketplace sales go to. By default, this is 0x...dead
        effectively burning the tokens

        addWLVendingItem(address contract_, string calldata title_, 
        string calldata imageUri_, string calldata projectUri_,
        string calldata description_, uint32 amountAvailable_, uint32 deadline_,
        uint256 price_) is used to create a new WLVendingItem for your contract
        with the details as the input arguments stated.

        modifyWLVendingItem(address contract_, uint256 index_, 
        WLVendingItem memory WLVendingItem_) lets you modify a WLVendingItem.
        You have to pass in a tuple instead. Only use when necessary. Not
        recommended to use.

        deleteMostRecentWLVendingItem(address contract_) we use a .pop() for this so
        it can only delete the most recent item. For some mistakes that you made and
        want to erase them.

        manageController(address contract_, address operator_, bool bool_) is a special
        governance function which allows you to add controllers to the contract
        to do actions on your behalf. 
*/

abstract contract Ownable {
    address public owner; 
    constructor() { owner = msg.sender; }
    modifier onlyOwner { require(owner == msg.sender, "Not Owner!"); _; }
    function transferOwnership(address new_) external onlyOwner { owner = new_; }
}

interface IMartianMarket {
    // For Access Control
    function isAuthorized(address contract_, address operator_) external 
    view returns (bool);

    // For Price Controller
    function getFixedPriceOfItem(address contract_, uint256 index_) external 
    view returns (uint256);

    // For Token Controller
    function getDefaultTokenOfContract(address contract_) external 
    view returns (address);
}

contract MartianMarketPriceController is Ownable {

    // Interface of MM
    IMartianMarket public MM = 
        IMartianMarket(0xFD8f4aC172457FD30Df92395BC69d4eF6d92eDd4);
    function setMM(address address_) external onlyOwner {
        MM = IMartianMarket(address_);
    }

    // This is the lookup for price overrides
    mapping(address => mapping(uint256 => uint256)) public contractToIndexToPriceType;

    function getPriceOfItem(address contract_, uint256 index_) public view 
    returns (uint256) {
        if (contractToIndexToPriceType[contract_][index_] == 0) {
            return MM.getFixedPriceOfItem(contract_, index_);
        }
        else {
            revert("Override Unsupported!");
        }
    }
}

Contract Security Audit

Contract ABI

[{"inputs":[],"name":"MM","outputs":[{"internalType":"contract IMartianMarket","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"},{"internalType":"uint256","name":"","type":"uint256"}],"name":"contractToIndexToPriceType","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"contract_","type":"address"},{"internalType":"uint256","name":"index_","type":"uint256"}],"name":"getPriceOfItem","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"address_","type":"address"}],"name":"setMM","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"new_","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"}]

6080604052600180546001600160a01b03191673fd8f4ac172457fd30df92395bc69d4ef6d92edd417905534801561003657600080fd5b50600080546001600160a01b031916331790556103a5806100586000396000f3fe608060405234801561001057600080fd5b50600436106100625760003560e01c80631c4393f5146100675780633a21c7191461008d5780635167e34f146100b85780638da5cb5b146100cd578063f2fde38b146100e0578063f7bf10d7146100f3575b600080fd5b61007a61007536600461032c565b61011e565b6040519081526020015b60405180910390f35b6001546100a0906001600160a01b031681565b6040516001600160a01b039091168152602001610084565b6100cb6100c636600461030a565b61021c565b005b6000546100a0906001600160a01b031681565b6100cb6100ee36600461030a565b610285565b61007a61010136600461032c565b600260209081526000928352604080842090915290825290205481565b6001600160a01b03821660009081526002602090815260408083208484529091528120546101d157600154604051634e98fab560e01b81526001600160a01b0385811660048301526024820185905290911690634e98fab59060440160206040518083038186803b15801561019257600080fd5b505afa1580156101a6573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906101ca9190610356565b9050610216565b60405162461bcd60e51b81526020600482015260156024820152744f7665727269646520556e737570706f727465642160581b60448201526064015b60405180910390fd5b92915050565b6000546001600160a01b031633146102635760405162461bcd60e51b815260206004820152600a6024820152694e6f74204f776e65722160b01b604482015260640161020d565b600180546001600160a01b0319166001600160a01b0392909216919091179055565b6000546001600160a01b031633146102cc5760405162461bcd60e51b815260206004820152600a6024820152694e6f74204f776e65722160b01b604482015260640161020d565b600080546001600160a01b0319166001600160a01b0392909216919091179055565b80356001600160a01b038116811461030557600080fd5b919050565b60006020828403121561031c57600080fd5b610325826102ee565b9392505050565b6000806040838503121561033f57600080fd5b610348836102ee565b946020939093013593505050565b60006020828403121561036857600080fd5b505191905056fea26469706673582212201633fca8b7534f57a50406775360aace84f5a27ad173f6b7fdd86c2e97e7ef7864736f6c63430008070033

Deployed Bytecode

0x608060405234801561001057600080fd5b50600436106100625760003560e01c80631c4393f5146100675780633a21c7191461008d5780635167e34f146100b85780638da5cb5b146100cd578063f2fde38b146100e0578063f7bf10d7146100f3575b600080fd5b61007a61007536600461032c565b61011e565b6040519081526020015b60405180910390f35b6001546100a0906001600160a01b031681565b6040516001600160a01b039091168152602001610084565b6100cb6100c636600461030a565b61021c565b005b6000546100a0906001600160a01b031681565b6100cb6100ee36600461030a565b610285565b61007a61010136600461032c565b600260209081526000928352604080842090915290825290205481565b6001600160a01b03821660009081526002602090815260408083208484529091528120546101d157600154604051634e98fab560e01b81526001600160a01b0385811660048301526024820185905290911690634e98fab59060440160206040518083038186803b15801561019257600080fd5b505afa1580156101a6573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906101ca9190610356565b9050610216565b60405162461bcd60e51b81526020600482015260156024820152744f7665727269646520556e737570706f727465642160581b60448201526064015b60405180910390fd5b92915050565b6000546001600160a01b031633146102635760405162461bcd60e51b815260206004820152600a6024820152694e6f74204f776e65722160b01b604482015260640161020d565b600180546001600160a01b0319166001600160a01b0392909216919091179055565b6000546001600160a01b031633146102cc5760405162461bcd60e51b815260206004820152600a6024820152694e6f74204f776e65722160b01b604482015260640161020d565b600080546001600160a01b0319166001600160a01b0392909216919091179055565b80356001600160a01b038116811461030557600080fd5b919050565b60006020828403121561031c57600080fd5b610325826102ee565b9392505050565b6000806040838503121561033f57600080fd5b610348836102ee565b946020939093013593505050565b60006020828403121561036857600080fd5b505191905056fea26469706673582212201633fca8b7534f57a50406775360aace84f5a27ad173f6b7fdd86c2e97e7ef7864736f6c63430008070033

Deployed Bytecode Sourcemap

5363:749:0:-:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;5792:317;;;;;;:::i;:::-;;:::i;:::-;;;2382:25:1;;;2370:2;2355:18;5792:317:0;;;;;;;;5445:95;;;;;-1:-1:-1;;;;;5445:95:0;;;;;;-1:-1:-1;;;;;995:32:1;;;977:51;;965:2;950:18;5445:95:0;831:203:1;5547:100:0;;;;;;:::i;:::-;;:::i;:::-;;4704:20;;;;;-1:-1:-1;;;;;4704:20:0;;;4850:77;;;;;;:::i;:::-;;:::i;5702:81::-;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;;5792:317;-1:-1:-1;;;;;5902:37:0;;5878:7;5902:37;;;:26;:37;;;;;;;;:45;;;;;;;;;5898:204;;5976:2;;:41;;-1:-1:-1;;;5976:41:0;;-1:-1:-1;;;;;1231:32:1;;;5976:41:0;;;1213:51:1;1280:18;;;1273:34;;;5976:2:0;;;;:22;;1186:18:1;;5976:41:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;5969:48;;;;5898:204;6059:31;;-1:-1:-1;;;6059:31:0;;2088:2:1;6059:31:0;;;2070:21:1;2127:2;2107:18;;;2100:30;-1:-1:-1;;;2146:18:1;;;2139:51;2207:18;;6059:31:0;;;;;;;;5898:204;5792:317;;;;:::o;5547:100::-;4804:5;;-1:-1:-1;;;;;4804:5:0;4813:10;4804:19;4796:42;;;;-1:-1:-1;;;4796:42:0;;1749:2:1;4796:42:0;;;1731:21:1;1788:2;1768:18;;;1761:30;-1:-1:-1;;;1807:18:1;;;1800:40;1857:18;;4796:42:0;1547:334:1;4796:42:0;5610:2:::1;:29:::0;;-1:-1:-1;;;;;;5610:29:0::1;-1:-1:-1::0;;;;;5610:29:0;;;::::1;::::0;;;::::1;::::0;;5547:100::o;4850:77::-;4804:5;;-1:-1:-1;;;;;4804:5:0;4813:10;4804:19;4796:42;;;;-1:-1:-1;;;4796:42:0;;1749:2:1;4796:42:0;;;1731:21:1;1788:2;1768:18;;;1761:30;-1:-1:-1;;;1807:18:1;;;1800:40;1857:18;;4796:42:0;1547:334:1;4796:42:0;4912:5:::1;:12:::0;;-1:-1:-1;;;;;;4912:12:0::1;-1:-1:-1::0;;;;;4912:12:0;;;::::1;::::0;;;::::1;::::0;;4850:77::o;14:173:1:-;82:20;;-1:-1:-1;;;;;131:31:1;;121:42;;111:70;;177:1;174;167:12;111:70;14:173;;;:::o;192:186::-;251:6;304:2;292:9;283:7;279:23;275:32;272:52;;;320:1;317;310:12;272:52;343:29;362:9;343:29;:::i;:::-;333:39;192:186;-1:-1:-1;;;192:186:1:o;383:254::-;451:6;459;512:2;500:9;491:7;487:23;483:32;480:52;;;528:1;525;518:12;480:52;551:29;570:9;551:29;:::i;:::-;541:39;627:2;612:18;;;;599:32;;-1:-1:-1;;;383:254:1:o;642:184::-;712:6;765:2;753:9;744:7;740:23;736:32;733:52;;;781:1;778;771:12;733:52;-1:-1:-1;804:16:1;;642:184;-1:-1:-1;642:184:1:o

Swarm Source

ipfs://1633fca8b7534f57a50406775360aace84f5a27ad173f6b7fdd86c2e97e7ef78

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.