ETH Price: $3,483.77 (+2.69%)

Contract

0xB133F2F6DEce3590f868F5279EA93dd3be4c6b03
 

Overview

ETH Balance

0 ETH

Eth Value

$0.00

Multichain Info

No addresses found
Transaction Hash
Method
Block
From
To
Mint Yang Editio...173011922023-05-20 14:20:35584 days ago1684592435IN
0xB133F2F6...3be4c6b03
0 ETH0.0040694834.99607074
Mint Yang Editio...173011522023-05-20 14:12:35584 days ago1684591955IN
0xB133F2F6...3be4c6b03
0 ETH0.0043581635.99289048
Mint Yin Edition173011492023-05-20 14:11:59584 days ago1684591919IN
0xB133F2F6...3be4c6b03
0 ETH0.0042172336.27637627
Mint Yang Editio...173010002023-05-20 13:41:59584 days ago1684590119IN
0xB133F2F6...3be4c6b03
0 ETH0.003604831
Mint Yin Edition173010002023-05-20 13:41:59584 days ago1684590119IN
0xB133F2F6...3be4c6b03
0 ETH0.0036038431
Mint Yang Editio...172998222023-05-20 9:42:59584 days ago1684575779IN
0xB133F2F6...3be4c6b03
0 ETH0.0035261730.32379879
Mint Yin Edition172998212023-05-20 9:42:47584 days ago1684575767IN
0xB133F2F6...3be4c6b03
0 ETH0.0034891830.01368832
Mint Yin Edition172981962023-05-20 4:15:11584 days ago1684556111IN
0xB133F2F6...3be4c6b03
0 ETH0.0037613132.35460203
Mint Yang Editio...172981762023-05-20 4:11:11584 days ago1684555871IN
0xB133F2F6...3be4c6b03
0 ETH0.0035057630.14828681
Mint Yang Editio...172978872023-05-20 3:12:47585 days ago1684552367IN
0xB133F2F6...3be4c6b03
0 ETH0.0041030633.88607346
Mint Yin Edition172978852023-05-20 3:12:23585 days ago1684552343IN
0xB133F2F6...3be4c6b03
0 ETH0.0037473630.956417
Mint Yang Editio...172937752023-05-19 13:17:23585 days ago1684502243IN
0xB133F2F6...3be4c6b03
0 ETH0.0047884441.17889828
Mint Yin Edition172937742023-05-19 13:17:11585 days ago1684502231IN
0xB133F2F6...3be4c6b03
0 ETH0.0048924642.08465028
Mint Yin Edition172913682023-05-19 5:08:11585 days ago1684472891IN
0xB133F2F6...3be4c6b03
0 ETH0.0040079234.47589401
Mint Yin Edition172870592023-05-18 14:34:47586 days ago1684420487IN
0xB133F2F6...3be4c6b03
0 ETH0.0073395160.63056383
Mint Yang Editio...172865402023-05-18 12:49:47586 days ago1684414187IN
0xB133F2F6...3be4c6b03
0 ETH0.0046915340.34548706
Mint Yang Editio...172864142023-05-18 12:24:23586 days ago1684412663IN
0xB133F2F6...3be4c6b03
0 ETH0.0050862343.73976776
Mint Yang Editio...172855472023-05-18 9:28:59586 days ago1684402139IN
0xB133F2F6...3be4c6b03
0 ETH0.0040822435.10584723
Mint Yin Edition172854982023-05-18 9:18:59586 days ago1684401539IN
0xB133F2F6...3be4c6b03
0 ETH0.0041885936.03001359
Mint Yang Editio...172851422023-05-18 8:06:47586 days ago1684397207IN
0xB133F2F6...3be4c6b03
0 ETH0.0044205536.50816846
Mint Yin Edition172821752023-05-17 22:04:11587 days ago1684361051IN
0xB133F2F6...3be4c6b03
0 ETH0.0088173775.84641063
Mint Yin Edition172813462023-05-17 19:16:35587 days ago1684350995IN
0xB133F2F6...3be4c6b03
0 ETH0.0082700971.13880876
Mint Yin Edition172796442023-05-17 13:27:47587 days ago1684330067IN
0xB133F2F6...3be4c6b03
0 ETH0.0067361355.64617791
Mint Yang Editio...172796102023-05-17 13:20:59587 days ago1684329659IN
0xB133F2F6...3be4c6b03
0 ETH0.0059068550.7968235
Mint Yin Edition172796082023-05-17 13:20:35587 days ago1684329635IN
0xB133F2F6...3be4c6b03
0 ETH0.0062259153.55491124
View all transactions

View more zero value Internal Transactions in Advanced View mode

Advanced mode:
Loading...
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
RTokenExchange

Compiler Version
v0.8.17+commit.8df45f5f

Optimization Enabled:
Yes with 300 runs

Other Settings:
default evmVersion
File 1 of 1 : ReviverArtBurn.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.17;

/**
 * @title ReviverArt abstract contract
 * @dev This contract defines the required methods for interacting with the ReviverArt token contract.
 */
abstract contract ReviverArt {
    function mintBaseExisting(
        address[] calldata to,
        uint256[] calldata tokenIds,
        uint256[] calldata amounts
    ) public virtual;

    function burn(
        address account,
        uint256[] memory tokenIds,
        uint256[] memory amounts
    ) public virtual;

    function balanceOf(
        address account,
        uint256 id
    ) external view virtual returns (uint256);
}

/**
 * @title RTokenExchange contract
 * @dev This contract allows users to exchange YIN and YANG Magatama tokens for YIN and YANG Edition tokens.
 */
contract RTokenExchange {
    // Reference to the ReviverArt token contract
    ReviverArt public reviverArt;

    // The start time of the exchange window (Unix timestamp)
    uint256 private constant startTime = 1684166400; // 2023-05-16 00:00:00 GMT+8

    // The duration of the exchange window (5 days)
    uint256 private constant duration = 5 days;

    // Token IDs for YIN Magatama, YANG Magatama, YIN Edition, and YANG Edition tokens
    uint256 private constant yinMagatamaId = 3;
    uint256 private constant yangMagatamaId = 4;
    uint256 private constant yinEditionId = 25;
    uint256 private constant yangEditionId = 26;

    /**
     * @dev RTokenExchange constructor
     * Initializes the reference to the ReviverArt token contract.
     */
    constructor() {
        reviverArt = ReviverArt(0x890dc5Dd5fc40c056c8D4152eDB146a1c76d1C29);
    }

    /**
     * @dev Modifier to check if the current time is within the exchange window.
     */
    modifier withinTimeWindow() {
        require(block.timestamp >= startTime, "Exchange not started yet");
        require(
            block.timestamp <= startTime + duration,
            "Exchange period has ended"
        );
        _;
    }

    /**
     * @dev Allows users to exchange YIN Magatama tokens for YIN Edition tokens.
     * Users need to burn 4 YIN Magatama tokens for each YIN Edition token they want to mint.
     * @param amount The number of YIN Edition tokens the user wants to mint.
     */
    function mintYinEdition(uint256 amount) external withinTimeWindow {
        uint256 yinMagatamaBalance = reviverArt.balanceOf(
            msg.sender,
            yinMagatamaId
        );
        uint256 requiredYinMagatama = 4 * amount;
        require(
            yinMagatamaBalance >= requiredYinMagatama,
            "Insufficient YIN Magatama balance"
        );

        address[] memory recipients = new address[](1);
        recipients[0] = msg.sender;

        uint256[] memory tokenIdsToBurn = new uint256[](1);
        tokenIdsToBurn[0] = yinMagatamaId;

        uint256[] memory amountsToBurn = new uint256[](1);
        amountsToBurn[0] = requiredYinMagatama;

        uint256[] memory tokenIdsToMint = new uint256[](1);
        tokenIdsToMint[0] = yinEditionId;
        uint256[] memory amountsToMint = new uint256[](1);
        amountsToMint[0] = amount;

        reviverArt.burn(msg.sender, tokenIdsToBurn, amountsToBurn);
        reviverArt.mintBaseExisting(recipients, tokenIdsToMint, amountsToMint);
    }

    /**
     * @dev Allows users to exchange YANG Magatama tokens for YANG Edition tokens.
     * Users need to burn 4 YANG Magatama tokens for each YANG Edition token they want to mint.
     * @param amount The number of YANG Edition tokens the user wants to mint.
     */
    function mintYangEdition(uint256 amount) external withinTimeWindow {
        uint256 yangMagatamaBalance = reviverArt.balanceOf(
            msg.sender,
            yangMagatamaId
        );
        uint256 requiredYangMagatama = 4 * amount;
        require(
            yangMagatamaBalance >= requiredYangMagatama,
            "Insufficient YANG Magatama balance"
        );

        address[] memory recipients = new address[](1);
        recipients[0] = msg.sender;

        uint256[] memory tokenIdsToBurn = new uint256[](1);
        tokenIdsToBurn[0] = yangMagatamaId;

        uint256[] memory amountsToBurn = new uint256[](1);
        amountsToBurn[0] = requiredYangMagatama;

        uint256[] memory tokenIdsToMint = new uint256[](1);
        tokenIdsToMint[0] = yangEditionId;

        uint256[] memory amountsToMint = new uint256[](1);
        amountsToMint[0] = amount;

        reviverArt.burn(msg.sender, tokenIdsToBurn, amountsToBurn);
        reviverArt.mintBaseExisting(recipients, tokenIdsToMint, amountsToMint);
    }
}

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

Contract Security Audit

Contract ABI

[{"inputs":[],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"mintYangEdition","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"mintYinEdition","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"reviverArt","outputs":[{"internalType":"contract ReviverArt","name":"","type":"address"}],"stateMutability":"view","type":"function"}]

608060405234801561001057600080fd5b50600080546001600160a01b03191673890dc5dd5fc40c056c8d4152edb146a1c76d1c291790556108a7806100466000396000f3fe608060405234801561001057600080fd5b50600436106100415760003560e01c80631981abac14610046578063841606f014610075578063f87eee821461008a575b600080fd5b600054610059906001600160a01b031681565b6040516001600160a01b03909116815260200160405180910390f35b6100886100833660046106ff565b61009d565b005b6100886100983660046106ff565b610461565b63646257004210156100f15760405162461bcd60e51b8152602060048201526018602482015277115e18da185b99d9481b9bdd081cdd185c9d1959081e595d60421b60448201526064015b60405180910390fd5b61010262069780636462570061072e565b4211156101515760405162461bcd60e51b815260206004820152601960248201527f45786368616e676520706572696f642068617320656e6465640000000000000060448201526064016100e8565b60008054604051627eeac760e11b8152336004820152600360248201526001600160a01b039091169062fdd58e90604401602060405180830381865afa15801561019f573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906101c39190610747565b905060006101d2836004610760565b90508082101561022e5760405162461bcd60e51b815260206004820152602160248201527f496e73756666696369656e742059494e204d61676174616d612062616c616e636044820152606560f81b60648201526084016100e8565b60408051600180825281830190925260009160208083019080368337019050509050338160008151811061026457610264610777565b6001600160a01b0392909216602092830291909101909101526040805160018082528183019092526000918160200160208202803683370190505090506003816000815181106102b6576102b6610777565b602090810291909101015260408051600180825281830190925260009181602001602082028036833701905050905083816000815181106102f9576102f9610777565b602090810291909101015260408051600180825281830190925260009181602001602082028036833701905050905060198160008151811061033d5761033d610777565b6020908102919091010152604080516001808252818301909252600091816020016020820280368337019050509050878160008151811061038057610380610777565b6020908102919091010152600054604051633db0f8ab60e01b81526001600160a01b0390911690633db0f8ab906103bf903390889088906004016107c8565b600060405180830381600087803b1580156103d957600080fd5b505af11580156103ed573d6000803e3d6000fd5b50506000546040516334ae4b7360e11b81526001600160a01b03909116925063695c96e6915061042590889086908690600401610806565b600060405180830381600087803b15801561043f57600080fd5b505af1158015610453573d6000803e3d6000fd5b505050505050505050505050565b63646257004210156104b05760405162461bcd60e51b8152602060048201526018602482015277115e18da185b99d9481b9bdd081cdd185c9d1959081e595d60421b60448201526064016100e8565b6104c162069780636462570061072e565b4211156105105760405162461bcd60e51b815260206004820152601960248201527f45786368616e676520706572696f642068617320656e6465640000000000000060448201526064016100e8565b60008054604051627eeac760e11b81523360048083019190915260248201526001600160a01b039091169062fdd58e90604401602060405180830381865afa158015610560573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906105849190610747565b90506000610593836004610760565b9050808210156105f05760405162461bcd60e51b815260206004820152602260248201527f496e73756666696369656e742059414e47204d61676174616d612062616c616e604482015261636560f01b60648201526084016100e8565b60408051600180825281830190925260009160208083019080368337019050509050338160008151811061062657610626610777565b6001600160a01b03929092166020928302919091019091015260408051600180825281830190925260009181602001602082028036833701905050905060048160008151811061067857610678610777565b602090810291909101015260408051600180825281830190925260009181602001602082028036833701905050905083816000815181106106bb576106bb610777565b6020908102919091010152604080516001808252818301909252600091816020016020820280368337019050509050601a8160008151811061033d5761033d610777565b60006020828403121561071157600080fd5b5035919050565b634e487b7160e01b600052601160045260246000fd5b8082018082111561074157610741610718565b92915050565b60006020828403121561075957600080fd5b5051919050565b808202811582820484141761074157610741610718565b634e487b7160e01b600052603260045260246000fd5b600081518084526020808501945080840160005b838110156107bd578151875295820195908201906001016107a1565b509495945050505050565b6001600160a01b03841681526060602082015260006107ea606083018561078d565b82810360408401526107fc818561078d565b9695505050505050565b606080825284519082018190526000906020906080840190828801845b828110156108485781516001600160a01b031684529284019290840190600101610823565b5050508381038285015261085c818761078d565b91505082810360408401526107fc818561078d56fea26469706673582212203e41898e699c324f1d3e26284561c72df238d1cf2631e8b904be1059d5a02ebe64736f6c63430008110033

Deployed Bytecode

0x608060405234801561001057600080fd5b50600436106100415760003560e01c80631981abac14610046578063841606f014610075578063f87eee821461008a575b600080fd5b600054610059906001600160a01b031681565b6040516001600160a01b03909116815260200160405180910390f35b6100886100833660046106ff565b61009d565b005b6100886100983660046106ff565b610461565b63646257004210156100f15760405162461bcd60e51b8152602060048201526018602482015277115e18da185b99d9481b9bdd081cdd185c9d1959081e595d60421b60448201526064015b60405180910390fd5b61010262069780636462570061072e565b4211156101515760405162461bcd60e51b815260206004820152601960248201527f45786368616e676520706572696f642068617320656e6465640000000000000060448201526064016100e8565b60008054604051627eeac760e11b8152336004820152600360248201526001600160a01b039091169062fdd58e90604401602060405180830381865afa15801561019f573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906101c39190610747565b905060006101d2836004610760565b90508082101561022e5760405162461bcd60e51b815260206004820152602160248201527f496e73756666696369656e742059494e204d61676174616d612062616c616e636044820152606560f81b60648201526084016100e8565b60408051600180825281830190925260009160208083019080368337019050509050338160008151811061026457610264610777565b6001600160a01b0392909216602092830291909101909101526040805160018082528183019092526000918160200160208202803683370190505090506003816000815181106102b6576102b6610777565b602090810291909101015260408051600180825281830190925260009181602001602082028036833701905050905083816000815181106102f9576102f9610777565b602090810291909101015260408051600180825281830190925260009181602001602082028036833701905050905060198160008151811061033d5761033d610777565b6020908102919091010152604080516001808252818301909252600091816020016020820280368337019050509050878160008151811061038057610380610777565b6020908102919091010152600054604051633db0f8ab60e01b81526001600160a01b0390911690633db0f8ab906103bf903390889088906004016107c8565b600060405180830381600087803b1580156103d957600080fd5b505af11580156103ed573d6000803e3d6000fd5b50506000546040516334ae4b7360e11b81526001600160a01b03909116925063695c96e6915061042590889086908690600401610806565b600060405180830381600087803b15801561043f57600080fd5b505af1158015610453573d6000803e3d6000fd5b505050505050505050505050565b63646257004210156104b05760405162461bcd60e51b8152602060048201526018602482015277115e18da185b99d9481b9bdd081cdd185c9d1959081e595d60421b60448201526064016100e8565b6104c162069780636462570061072e565b4211156105105760405162461bcd60e51b815260206004820152601960248201527f45786368616e676520706572696f642068617320656e6465640000000000000060448201526064016100e8565b60008054604051627eeac760e11b81523360048083019190915260248201526001600160a01b039091169062fdd58e90604401602060405180830381865afa158015610560573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906105849190610747565b90506000610593836004610760565b9050808210156105f05760405162461bcd60e51b815260206004820152602260248201527f496e73756666696369656e742059414e47204d61676174616d612062616c616e604482015261636560f01b60648201526084016100e8565b60408051600180825281830190925260009160208083019080368337019050509050338160008151811061062657610626610777565b6001600160a01b03929092166020928302919091019091015260408051600180825281830190925260009181602001602082028036833701905050905060048160008151811061067857610678610777565b602090810291909101015260408051600180825281830190925260009181602001602082028036833701905050905083816000815181106106bb576106bb610777565b6020908102919091010152604080516001808252818301909252600091816020016020820280368337019050509050601a8160008151811061033d5761033d610777565b60006020828403121561071157600080fd5b5035919050565b634e487b7160e01b600052601160045260246000fd5b8082018082111561074157610741610718565b92915050565b60006020828403121561075957600080fd5b5051919050565b808202811582820484141761074157610741610718565b634e487b7160e01b600052603260045260246000fd5b600081518084526020808501945080840160005b838110156107bd578151875295820195908201906001016107a1565b509495945050505050565b6001600160a01b03841681526060602082015260006107ea606083018561078d565b82810360408401526107fc818561078d565b9695505050505050565b606080825284519082018190526000906020906080840190828801845b828110156108485781516001600160a01b031684529284019290840190600101610823565b5050508381038285015261085c818761078d565b91505082810360408401526107fc818561078d56fea26469706673582212203e41898e699c324f1d3e26284561c72df238d1cf2631e8b904be1059d5a02ebe64736f6c63430008110033

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.