ETH Price: $1,759.56 (+11.39%)
Gas: 1.85 Gwei
 

Overview

ETH Balance

0 ETH

Eth Value

$0.00

Multichain Info

No addresses found
Transaction Hash
Method
Block
From
To
Set Liquidity Ma...156252552022-09-27 14:21:47938 days ago1664288507IN
X7 Finance: X7DAO Discount Authority
0 ETH0.0007230215.12393445
Set Ecosystem Ma...156252532022-09-27 14:21:23938 days ago1664288483IN
X7 Finance: X7DAO Discount Authority
0 ETH0.000749215.67871962

View more zero value Internal Transactions in Advanced View mode

Advanced mode:
Loading...
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
X7DAODiscountAuthority

Compiler Version
v0.8.15+commit.e14f2714

Optimization Enabled:
Yes with 200 runs

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

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

/*

 /$$   /$$ /$$$$$$$$       /$$$$$$$$ /$$
| $$  / $$|_____ $$/      | $$_____/|__/
|  $$/ $$/     /$$/       | $$       /$$ /$$$$$$$   /$$$$$$  /$$$$$$$   /$$$$$$$  /$$$$$$
 \  $$$$/     /$$/        | $$$$$   | $$| $$__  $$ |____  $$| $$__  $$ /$$_____/ /$$__  $$
  >$$  $$    /$$/         | $$__/   | $$| $$  \ $$  /$$$$$$$| $$  \ $$| $$      | $$$$$$$$
 /$$/\  $$  /$$/          | $$      | $$| $$  | $$ /$$__  $$| $$  | $$| $$      | $$_____/
| $$  \ $$ /$$/           | $$      | $$| $$  | $$|  $$$$$$$| $$  | $$|  $$$$$$$|  $$$$$$$
|__/  |__/|__/            |__/      |__/|__/  |__/ \_______/|__/  |__/ \_______/ \_______/

Contract: Smart Contract for X7DAO fee discounts

This contract will NOT be renounced.

The following are the only functions that can be called on the contract that affect the contract:

    function setEcosystemMaxiNFT(address tokenAddress) external onlyOwner {
        require(address(ecoMaxiNFT) != tokenAddress);
        address oldTokenAddress = address(ecoMaxiNFT);
        ecoMaxiNFT = IERC721(tokenAddress);
        emit EcosystemMaxiNFTSet(oldTokenAddress, tokenAddress);
    }

    function setLiquidityMaxiNFT(address tokenAddress) external onlyOwner {
        require(address(liqMaxiNFT) != tokenAddress);
        address oldTokenAddress = address(liqMaxiNFT);
        liqMaxiNFT = IERC721(tokenAddress);
        emit LiquidityMaxiNFTSet(oldTokenAddress, tokenAddress);
    }

These functions will be passed to DAO governance once the ecosystem stabilizes.

*/

abstract contract Ownable {
    address private _owner;

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

    constructor(address owner_) {
        _transferOwnership(owner_);
    }

    modifier onlyOwner() {
        _checkOwner();
        _;
    }

    function owner() public view virtual returns (address) {
        return _owner;
    }

    function _checkOwner() internal view virtual {
        require(owner() == msg.sender, "Ownable: caller is not the owner");
    }

    function renounceOwnership() public virtual onlyOwner {
        _transferOwnership(address(0));
    }

    function transferOwnership(address newOwner) public virtual onlyOwner {
        require(newOwner != address(0), "Ownable: new owner is the zero address");
        _transferOwnership(newOwner);
    }

    function _transferOwnership(address newOwner) internal virtual {
        address oldOwner = _owner;
        _owner = newOwner;
        emit OwnershipTransferred(oldOwner, newOwner);
    }
}

interface IERC721 {
    function balanceOf(address owner) external view returns (uint256);
}

interface IDiscountAuthority {
    function discountRatio(address) external view returns (uint256, uint256);
}

contract X7DAODiscountAuthority is Ownable {

    IERC721 public ecoMaxiNFT;
    IERC721 public liqMaxiNFT;

    event EcosystemMaxiNFTSet(address indexed oldTokenAddress, address indexed newTokenAddress);
    event LiquidityMaxiNFTSet(address indexed oldTokenAddress, address indexed newTokenAddress);

    constructor() Ownable(address(0x7000a09c425ABf5173FF458dF1370C25d1C58105)) {}

    function setEcosystemMaxiNFT(address tokenAddress) external onlyOwner {
        require(address(ecoMaxiNFT) != tokenAddress);
        address oldTokenAddress = address(ecoMaxiNFT);
        ecoMaxiNFT = IERC721(tokenAddress);
        emit EcosystemMaxiNFTSet(oldTokenAddress, tokenAddress);
    }

    function setLiquidityMaxiNFT(address tokenAddress) external onlyOwner {
        require(address(liqMaxiNFT) != tokenAddress);
        address oldTokenAddress = address(liqMaxiNFT);
        liqMaxiNFT = IERC721(tokenAddress);
        emit LiquidityMaxiNFTSet(oldTokenAddress, tokenAddress);
    }

    function discountRatio(address swapper) external view returns (uint256 numerator, uint256 denominator) {
        numerator = 1;
        denominator = 1;

        if (liqMaxiNFT.balanceOf(swapper) > 0) {
            // 15% discount
            numerator = 85;
            denominator = 100;
        } else if (ecoMaxiNFT.balanceOf(swapper) > 0) {
            // 10% discount
            numerator = 90;
            denominator = 100;
        }
    }
}

Contract Security Audit

Contract ABI

API
[{"inputs":[],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"oldTokenAddress","type":"address"},{"indexed":true,"internalType":"address","name":"newTokenAddress","type":"address"}],"name":"EcosystemMaxiNFTSet","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"oldTokenAddress","type":"address"},{"indexed":true,"internalType":"address","name":"newTokenAddress","type":"address"}],"name":"LiquidityMaxiNFTSet","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"inputs":[{"internalType":"address","name":"swapper","type":"address"}],"name":"discountRatio","outputs":[{"internalType":"uint256","name":"numerator","type":"uint256"},{"internalType":"uint256","name":"denominator","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"ecoMaxiNFT","outputs":[{"internalType":"contract IERC721","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"liqMaxiNFT","outputs":[{"internalType":"contract IERC721","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"tokenAddress","type":"address"}],"name":"setEcosystemMaxiNFT","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"tokenAddress","type":"address"}],"name":"setLiquidityMaxiNFT","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"}]

608060405234801561001057600080fd5b50737000a09c425abf5173ff458df1370c25d1c5810561002f81610035565b50610085565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b610508806100946000396000f3fe608060405234801561001057600080fd5b50600436106100885760003560e01c8063715018a61161005b578063715018a61461010d5780638da5cb5b14610115578063a56b701014610126578063f2fde38b1461013957600080fd5b806307b6fb0f1461008d5780630accd75a146100bd5780631571a568146100e5578063532b5cf9146100fa575b600080fd5b6002546100a0906001600160a01b031681565b6040516001600160a01b0390911681526020015b60405180910390f35b6100d06100cb366004610489565b61014c565b604080519283526020830191909152016100b4565b6100f86100f3366004610489565b610256565b005b6100f8610108366004610489565b6102ca565b6100f861033e565b6000546001600160a01b03166100a0565b6001546100a0906001600160a01b031681565b6100f8610147366004610489565b610352565b6002546040516370a0823160e01b81526001600160a01b0383811660048301526001928392600092909116906370a0823190602401602060405180830381865afa15801561019e573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906101c291906104b9565b11156101d45750605590506064915091565b6001546040516370a0823160e01b81526001600160a01b03858116600483015260009216906370a0823190602401602060405180830381865afa15801561021f573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061024391906104b9565b11156102515750605a905060645b915091565b61025e6103d0565b6001546001600160a01b0380831691160361027857600080fd5b600180546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f5b3d3e51ada14ef3f4ce0d8cdc1270cb619f4ac67f18cdb136b48b19cc21e14f90600090a35050565b6102d26103d0565b6002546001600160a01b038083169116036102ec57600080fd5b600280546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f1713c58f9958e815e8db9bf06dafd5fc344e86296422f52157aab84005f2c89d90600090a35050565b6103466103d0565b6103506000610439565b565b61035a6103d0565b6001600160a01b0381166103c45760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084015b60405180910390fd5b6103cd81610439565b50565b336103e36000546001600160a01b031690565b6001600160a01b0316146103505760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064016103bb565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b60006020828403121561049b57600080fd5b81356001600160a01b03811681146104b257600080fd5b9392505050565b6000602082840312156104cb57600080fd5b505191905056fea26469706673582212205c86692687468635fd59924b2c13d6358d8d3eda88b1a4abc31703baec43f12f64736f6c634300080f0033

Deployed Bytecode

0x608060405234801561001057600080fd5b50600436106100885760003560e01c8063715018a61161005b578063715018a61461010d5780638da5cb5b14610115578063a56b701014610126578063f2fde38b1461013957600080fd5b806307b6fb0f1461008d5780630accd75a146100bd5780631571a568146100e5578063532b5cf9146100fa575b600080fd5b6002546100a0906001600160a01b031681565b6040516001600160a01b0390911681526020015b60405180910390f35b6100d06100cb366004610489565b61014c565b604080519283526020830191909152016100b4565b6100f86100f3366004610489565b610256565b005b6100f8610108366004610489565b6102ca565b6100f861033e565b6000546001600160a01b03166100a0565b6001546100a0906001600160a01b031681565b6100f8610147366004610489565b610352565b6002546040516370a0823160e01b81526001600160a01b0383811660048301526001928392600092909116906370a0823190602401602060405180830381865afa15801561019e573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906101c291906104b9565b11156101d45750605590506064915091565b6001546040516370a0823160e01b81526001600160a01b03858116600483015260009216906370a0823190602401602060405180830381865afa15801561021f573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061024391906104b9565b11156102515750605a905060645b915091565b61025e6103d0565b6001546001600160a01b0380831691160361027857600080fd5b600180546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f5b3d3e51ada14ef3f4ce0d8cdc1270cb619f4ac67f18cdb136b48b19cc21e14f90600090a35050565b6102d26103d0565b6002546001600160a01b038083169116036102ec57600080fd5b600280546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f1713c58f9958e815e8db9bf06dafd5fc344e86296422f52157aab84005f2c89d90600090a35050565b6103466103d0565b6103506000610439565b565b61035a6103d0565b6001600160a01b0381166103c45760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084015b60405180910390fd5b6103cd81610439565b50565b336103e36000546001600160a01b031690565b6001600160a01b0316146103505760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064016103bb565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b60006020828403121561049b57600080fd5b81356001600160a01b03811681146104b257600080fd5b9392505050565b6000602082840312156104cb57600080fd5b505191905056fea26469706673582212205c86692687468635fd59924b2c13d6358d8d3eda88b1a4abc31703baec43f12f64736f6c634300080f0033

Deployed Bytecode Sourcemap

2877:1481:0:-:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;2961:25;;;;;-1:-1:-1;;;;;2961:25:0;;;;;;-1:-1:-1;;;;;193:32:1;;;175:51;;163:2;148:18;2961:25:0;;;;;;;;3894:461;;;;;;:::i;:::-;;:::i;:::-;;;;702:25:1;;;758:2;743:18;;736:34;;;;675:18;3894:461:0;528:248:1;3278:300:0;;;;;;:::i;:::-;;:::i;:::-;;3586;;;;;;:::i;:::-;;:::i;2145:103::-;;;:::i;1912:87::-;1958:7;1985:6;-1:-1:-1;;;;;1985:6:0;1912:87;;2929:25;;;;;-1:-1:-1;;;;;2929:25:0;;;2256:201;;;;;;:::i;:::-;;:::i;3894:461::-;4064:10;;:29;;-1:-1:-1;;;4064:29:0;;-1:-1:-1;;;;;193:32:1;;;4064:29:0;;;175:51:1;4020:1:0;;;;3957:17;;4064:10;;;;:20;;148:18:1;;4064:29:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;:33;4060:288;;;-1:-1:-1;4155:2:0;;-1:-1:-1;4186:3:0;3894:461;;;:::o;4060:288::-;4211:10;;:29;;-1:-1:-1;;;4211:29:0;;-1:-1:-1;;;;;193:32:1;;;4211:29:0;;;175:51:1;4243:1:0;;4211:10;;:20;;148:18:1;;4211:29:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;:33;4207:141;;;-1:-1:-1;4302:2:0;;-1:-1:-1;4333:3:0;4207:141;3894:461;;;:::o;3278:300::-;1871:13;:11;:13::i;:::-;3375:10:::1;::::0;-1:-1:-1;;;;;3367:35:0;;::::1;3375:10:::0;::::1;3367:35:::0;3359:44:::1;;;::::0;::::1;;3448:10;::::0;;-1:-1:-1;;;;;3470:34:0;;::::1;-1:-1:-1::0;;;;;;3470:34:0;::::1;::::0;::::1;::::0;;;3520:50:::1;::::0;3448:10;::::1;::::0;3470:34;3448:10;;3520:50:::1;::::0;3414:23:::1;::::0;3520:50:::1;3348:230;3278:300:::0;:::o;3586:::-;1871:13;:11;:13::i;:::-;3683:10:::1;::::0;-1:-1:-1;;;;;3675:35:0;;::::1;3683:10:::0;::::1;3675:35:::0;3667:44:::1;;;::::0;::::1;;3756:10;::::0;;-1:-1:-1;;;;;3778:34:0;;::::1;-1:-1:-1::0;;;;;;3778:34:0;::::1;::::0;::::1;::::0;;;3828:50:::1;::::0;3756:10;::::1;::::0;3778:34;3756:10;;3828:50:::1;::::0;3722:23:::1;::::0;3828:50:::1;3656:230;3586:300:::0;:::o;2145:103::-;1871:13;:11;:13::i;:::-;2210:30:::1;2237:1;2210:18;:30::i;:::-;2145:103::o:0;2256:201::-;1871:13;:11;:13::i;:::-;-1:-1:-1;;;;;2345:22:0;::::1;2337:73;;;::::0;-1:-1:-1;;;2337:73:0;;1380:2:1;2337:73:0::1;::::0;::::1;1362:21:1::0;1419:2;1399:18;;;1392:30;1458:34;1438:18;;;1431:62;-1:-1:-1;;;1509:18:1;;;1502:36;1555:19;;2337:73:0::1;;;;;;;;;2421:28;2440:8;2421:18;:28::i;:::-;2256:201:::0;:::o;2007:130::-;2082:10;2071:7;1958;1985:6;-1:-1:-1;;;;;1985:6:0;;1912:87;2071:7;-1:-1:-1;;;;;2071:21:0;;2063:66;;;;-1:-1:-1;;;2063:66:0;;1787:2:1;2063:66:0;;;1769:21:1;;;1806:18;;;1799:30;1865:34;1845:18;;;1838:62;1917:18;;2063:66:0;1585:356:1;2465:191:0;2539:16;2558:6;;-1:-1:-1;;;;;2575:17:0;;;-1:-1:-1;;;;;;2575:17:0;;;;;;2608:40;;2558:6;;;;;;;2608:40;;2539:16;2608:40;2528:128;2465:191;:::o;237:286:1:-;296:6;349:2;337:9;328:7;324:23;320:32;317:52;;;365:1;362;355:12;317:52;391:23;;-1:-1:-1;;;;;443:31:1;;433:42;;423:70;;489:1;486;479:12;423:70;512:5;237:286;-1:-1:-1;;;237:286:1:o;989:184::-;1059:6;1112:2;1100:9;1091:7;1087:23;1083:32;1080:52;;;1128:1;1125;1118:12;1080:52;-1:-1:-1;1151:16:1;;989:184;-1:-1:-1;989:184:1:o

Swarm Source

ipfs://5c86692687468635fd59924b2c13d6358d8d3eda88b1a4abc31703baec43f12f

Block Transaction Difficulty Gas Used Reward
View All Blocks Produced

Block Uncle Number Difficulty Gas Used Reward
View All Uncles
Loading...
Loading
Loading...
Loading

OVERVIEW

The X7DAO Discount Authority determines if any discount applies to the X7DAO token fee collection.

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.