Feature Tip: Add private address tag to any address under My Name Tag !
Overview
ETH Balance
0 ETH
Eth Value
$0.00More Info
Private Name Tags
ContractCreator
Latest 25 from a total of 63 transactions
Transaction Hash |
Method
|
Block
|
From
|
To
|
|||||
---|---|---|---|---|---|---|---|---|---|
Mint Yang Editio... | 17301192 | 584 days ago | IN | 0 ETH | 0.00406948 | ||||
Mint Yang Editio... | 17301152 | 584 days ago | IN | 0 ETH | 0.00435816 | ||||
Mint Yin Edition | 17301149 | 584 days ago | IN | 0 ETH | 0.00421723 | ||||
Mint Yang Editio... | 17301000 | 584 days ago | IN | 0 ETH | 0.0036048 | ||||
Mint Yin Edition | 17301000 | 584 days ago | IN | 0 ETH | 0.00360384 | ||||
Mint Yang Editio... | 17299822 | 584 days ago | IN | 0 ETH | 0.00352617 | ||||
Mint Yin Edition | 17299821 | 584 days ago | IN | 0 ETH | 0.00348918 | ||||
Mint Yin Edition | 17298196 | 584 days ago | IN | 0 ETH | 0.00376131 | ||||
Mint Yang Editio... | 17298176 | 584 days ago | IN | 0 ETH | 0.00350576 | ||||
Mint Yang Editio... | 17297887 | 585 days ago | IN | 0 ETH | 0.00410306 | ||||
Mint Yin Edition | 17297885 | 585 days ago | IN | 0 ETH | 0.00374736 | ||||
Mint Yang Editio... | 17293775 | 585 days ago | IN | 0 ETH | 0.00478844 | ||||
Mint Yin Edition | 17293774 | 585 days ago | IN | 0 ETH | 0.00489246 | ||||
Mint Yin Edition | 17291368 | 585 days ago | IN | 0 ETH | 0.00400792 | ||||
Mint Yin Edition | 17287059 | 586 days ago | IN | 0 ETH | 0.00733951 | ||||
Mint Yang Editio... | 17286540 | 586 days ago | IN | 0 ETH | 0.00469153 | ||||
Mint Yang Editio... | 17286414 | 586 days ago | IN | 0 ETH | 0.00508623 | ||||
Mint Yang Editio... | 17285547 | 586 days ago | IN | 0 ETH | 0.00408224 | ||||
Mint Yin Edition | 17285498 | 586 days ago | IN | 0 ETH | 0.00418859 | ||||
Mint Yang Editio... | 17285142 | 586 days ago | IN | 0 ETH | 0.00442055 | ||||
Mint Yin Edition | 17282175 | 587 days ago | IN | 0 ETH | 0.00881737 | ||||
Mint Yin Edition | 17281346 | 587 days ago | IN | 0 ETH | 0.00827009 | ||||
Mint Yin Edition | 17279644 | 587 days ago | IN | 0 ETH | 0.00673613 | ||||
Mint Yang Editio... | 17279610 | 587 days ago | IN | 0 ETH | 0.00590685 | ||||
Mint Yin Edition | 17279608 | 587 days ago | IN | 0 ETH | 0.00622591 |
View more zero value Internal Transactions in Advanced View mode
Advanced mode:
Loading...
Loading
Contract Name:
RTokenExchange
Compiler Version
v0.8.17+commit.8df45f5f
Optimization Enabled:
Yes with 300 runs
Other Settings:
default evmVersion
Contract Source Code (Solidity Standard Json-Input format)
// 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); } }
{ "optimizer": { "enabled": true, "runs": 300 }, "outputSelection": { "*": { "*": [ "evm.bytecode", "evm.deployedBytecode", "devdoc", "userdoc", "metadata", "abi" ] } }, "libraries": {} }
Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
[{"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"}]
Contract Creation Code
608060405234801561001057600080fd5b50600080546001600160a01b03191673890dc5dd5fc40c056c8d4152edb146a1c76d1c291790556108a7806100466000396000f3fe608060405234801561001057600080fd5b50600436106100415760003560e01c80631981abac14610046578063841606f014610075578063f87eee821461008a575b600080fd5b600054610059906001600160a01b031681565b6040516001600160a01b03909116815260200160405180910390f35b6100886100833660046106ff565b61009d565b005b6100886100983660046106ff565b610461565b63646257004210156100f15760405162461bcd60e51b8152602060048201526018602482015277115e18da185b99d9481b9bdd081cdd185c9d1959081e595d60421b60448201526064015b60405180910390fd5b61010262069780636462570061072e565b4211156101515760405162461bcd60e51b815260206004820152601960248201527f45786368616e676520706572696f642068617320656e6465640000000000000060448201526064016100e8565b60008054604051627eeac760e11b8152336004820152600360248201526001600160a01b039091169062fdd58e90604401602060405180830381865afa15801561019f573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906101c39190610747565b905060006101d2836004610760565b90508082101561022e5760405162461bcd60e51b815260206004820152602160248201527f496e73756666696369656e742059494e204d61676174616d612062616c616e636044820152606560f81b60648201526084016100e8565b60408051600180825281830190925260009160208083019080368337019050509050338160008151811061026457610264610777565b6001600160a01b0392909216602092830291909101909101526040805160018082528183019092526000918160200160208202803683370190505090506003816000815181106102b6576102b6610777565b602090810291909101015260408051600180825281830190925260009181602001602082028036833701905050905083816000815181106102f9576102f9610777565b602090810291909101015260408051600180825281830190925260009181602001602082028036833701905050905060198160008151811061033d5761033d610777565b6020908102919091010152604080516001808252818301909252600091816020016020820280368337019050509050878160008151811061038057610380610777565b6020908102919091010152600054604051633db0f8ab60e01b81526001600160a01b0390911690633db0f8ab906103bf903390889088906004016107c8565b600060405180830381600087803b1580156103d957600080fd5b505af11580156103ed573d6000803e3d6000fd5b50506000546040516334ae4b7360e11b81526001600160a01b03909116925063695c96e6915061042590889086908690600401610806565b600060405180830381600087803b15801561043f57600080fd5b505af1158015610453573d6000803e3d6000fd5b505050505050505050505050565b63646257004210156104b05760405162461bcd60e51b8152602060048201526018602482015277115e18da185b99d9481b9bdd081cdd185c9d1959081e595d60421b60448201526064016100e8565b6104c162069780636462570061072e565b4211156105105760405162461bcd60e51b815260206004820152601960248201527f45786368616e676520706572696f642068617320656e6465640000000000000060448201526064016100e8565b60008054604051627eeac760e11b81523360048083019190915260248201526001600160a01b039091169062fdd58e90604401602060405180830381865afa158015610560573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906105849190610747565b90506000610593836004610760565b9050808210156105f05760405162461bcd60e51b815260206004820152602260248201527f496e73756666696369656e742059414e47204d61676174616d612062616c616e604482015261636560f01b60648201526084016100e8565b60408051600180825281830190925260009160208083019080368337019050509050338160008151811061062657610626610777565b6001600160a01b03929092166020928302919091019091015260408051600180825281830190925260009181602001602082028036833701905050905060048160008151811061067857610678610777565b602090810291909101015260408051600180825281830190925260009181602001602082028036833701905050905083816000815181106106bb576106bb610777565b6020908102919091010152604080516001808252818301909252600091816020016020820280368337019050509050601a8160008151811061033d5761033d610777565b60006020828403121561071157600080fd5b5035919050565b634e487b7160e01b600052601160045260246000fd5b8082018082111561074157610741610718565b92915050565b60006020828403121561075957600080fd5b5051919050565b808202811582820484141761074157610741610718565b634e487b7160e01b600052603260045260246000fd5b600081518084526020808501945080840160005b838110156107bd578151875295820195908201906001016107a1565b509495945050505050565b6001600160a01b03841681526060602082015260006107ea606083018561078d565b82810360408401526107fc818561078d565b9695505050505050565b606080825284519082018190526000906020906080840190828801845b828110156108485781516001600160a01b031684529284019290840190600101610823565b5050508381038285015261085c818761078d565b91505082810360408401526107fc818561078d56fea26469706673582212203e41898e699c324f1d3e26284561c72df238d1cf2631e8b904be1059d5a02ebe64736f6c63430008110033
Deployed Bytecode
0x608060405234801561001057600080fd5b50600436106100415760003560e01c80631981abac14610046578063841606f014610075578063f87eee821461008a575b600080fd5b600054610059906001600160a01b031681565b6040516001600160a01b03909116815260200160405180910390f35b6100886100833660046106ff565b61009d565b005b6100886100983660046106ff565b610461565b63646257004210156100f15760405162461bcd60e51b8152602060048201526018602482015277115e18da185b99d9481b9bdd081cdd185c9d1959081e595d60421b60448201526064015b60405180910390fd5b61010262069780636462570061072e565b4211156101515760405162461bcd60e51b815260206004820152601960248201527f45786368616e676520706572696f642068617320656e6465640000000000000060448201526064016100e8565b60008054604051627eeac760e11b8152336004820152600360248201526001600160a01b039091169062fdd58e90604401602060405180830381865afa15801561019f573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906101c39190610747565b905060006101d2836004610760565b90508082101561022e5760405162461bcd60e51b815260206004820152602160248201527f496e73756666696369656e742059494e204d61676174616d612062616c616e636044820152606560f81b60648201526084016100e8565b60408051600180825281830190925260009160208083019080368337019050509050338160008151811061026457610264610777565b6001600160a01b0392909216602092830291909101909101526040805160018082528183019092526000918160200160208202803683370190505090506003816000815181106102b6576102b6610777565b602090810291909101015260408051600180825281830190925260009181602001602082028036833701905050905083816000815181106102f9576102f9610777565b602090810291909101015260408051600180825281830190925260009181602001602082028036833701905050905060198160008151811061033d5761033d610777565b6020908102919091010152604080516001808252818301909252600091816020016020820280368337019050509050878160008151811061038057610380610777565b6020908102919091010152600054604051633db0f8ab60e01b81526001600160a01b0390911690633db0f8ab906103bf903390889088906004016107c8565b600060405180830381600087803b1580156103d957600080fd5b505af11580156103ed573d6000803e3d6000fd5b50506000546040516334ae4b7360e11b81526001600160a01b03909116925063695c96e6915061042590889086908690600401610806565b600060405180830381600087803b15801561043f57600080fd5b505af1158015610453573d6000803e3d6000fd5b505050505050505050505050565b63646257004210156104b05760405162461bcd60e51b8152602060048201526018602482015277115e18da185b99d9481b9bdd081cdd185c9d1959081e595d60421b60448201526064016100e8565b6104c162069780636462570061072e565b4211156105105760405162461bcd60e51b815260206004820152601960248201527f45786368616e676520706572696f642068617320656e6465640000000000000060448201526064016100e8565b60008054604051627eeac760e11b81523360048083019190915260248201526001600160a01b039091169062fdd58e90604401602060405180830381865afa158015610560573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906105849190610747565b90506000610593836004610760565b9050808210156105f05760405162461bcd60e51b815260206004820152602260248201527f496e73756666696369656e742059414e47204d61676174616d612062616c616e604482015261636560f01b60648201526084016100e8565b60408051600180825281830190925260009160208083019080368337019050509050338160008151811061062657610626610777565b6001600160a01b03929092166020928302919091019091015260408051600180825281830190925260009181602001602082028036833701905050905060048160008151811061067857610678610777565b602090810291909101015260408051600180825281830190925260009181602001602082028036833701905050905083816000815181106106bb576106bb610777565b6020908102919091010152604080516001808252818301909252600091816020016020820280368337019050509050601a8160008151811061033d5761033d610777565b60006020828403121561071157600080fd5b5035919050565b634e487b7160e01b600052601160045260246000fd5b8082018082111561074157610741610718565b92915050565b60006020828403121561075957600080fd5b5051919050565b808202811582820484141761074157610741610718565b634e487b7160e01b600052603260045260246000fd5b600081518084526020808501945080840160005b838110156107bd578151875295820195908201906001016107a1565b509495945050505050565b6001600160a01b03841681526060602082015260006107ea606083018561078d565b82810360408401526107fc818561078d565b9695505050505050565b606080825284519082018190526000906020906080840190828801845b828110156108485781516001600160a01b031684529284019290840190600101610823565b5050508381038285015261085c818761078d565b91505082810360408401526107fc818561078d56fea26469706673582212203e41898e699c324f1d3e26284561c72df238d1cf2631e8b904be1059d5a02ebe64736f6c63430008110033
Loading...
Loading
Loading...
Loading
Multichain Portfolio | 30 Chains
Chain | Token | Portfolio % | Price | Amount | Value |
---|
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.