Description:
Multi-signature wallet contract requiring multiple confirmations for transaction execution.
Blockchain: Ethereum
Source Code: View Code On The Blockchain
Solidity Source Code:
{{
"language": "Solidity",
"sources": {
"artifacts/XTR/Token.sol": {
"content": "/*\r
\r
============================\r
STRATEGX - XTR\r
__ __ _______ _____ \r
\ \ / /|__ __| __ \ \r
\ V / | | | |__) |\r
> < | | | _ / \r
/ . \ | | | | \ \ \r
/_/ \_\ |_| |_| \_\\r
\r
============================\r
\r
*/\r
\r
\r
// SPDX-License-Identifier: No License\r
pragma solidity 0.8.25;\r
\r
import {IERC20, ERC20} from "./ERC20.sol";\r
import {ERC20Burnable} from "./ERC20Burnable.sol";\r
import {Ownable, Ownable2Step} from "./Ownable2Step.sol";\r
import {SafeERC20Remastered} from "./SafeERC20Remastered.sol";\r
\r
import {Initializable} from "./Initializable.sol";\r
import "./IUniswapV2Factory.sol";\r
import "./IUniswapV2Pair.sol";\r
import "./IUniswapV2Router01.sol";\r
import "./IUniswapV2Router02.sol";\r
\r
contract XTR is ERC20, ERC20Burnable, Ownable2Step, Initializable {\r
\r
using SafeERC20Remastered for IERC20;\r
\r
uint16 public swapThresholdRatio;\r
\r
uint256 private _taxxdPending;\r
\r
address public taxxdAddress;\r
uint16[3] public taxxdFees;\r
\r
mapping (address => bool) public isExcludedFromFees;\r
\r
uint16[3] public totalFees;\r
bool private _swapping;\r
\r
IUniswapV2Router02 public routerV2;\r
address public pairV2;\r
mapping (address => bool) public AMMs;\r
\r
error InvalidAmountToRecover(uint256 amount, uint256 maxAmount);\r
\r
error InvalidToken(address tokenAddress);\r
\r
error CannotDepositNativeCoins(address account);\r
\r
error InvalidSwapThresholdRatio(uint16 swapThresholdRatio);\r
\r
error InvalidTaxRecipientAddress(address account);\r
\r
error CannotExceedMaxTotalFee(uint16 buyFee, uint16 sellFee, uint16 transferFee);\r
\r
error InvalidAMM(address AMM);\r
\r
event SwapThresholdUpdated(uint16 swapThresholdRatio);\r
\r
event WalletTaxAddressUpdated(uint8 indexed id, address newAddress);\r
event WalletTaxFeesUpdated(uint8 indexed id, uint16 buyFee, uint16 sellFee, uint16 transferFee);\r
event WalletTaxSent(uint8 indexed id, address recipient, uint256 amount);\r
\r
event ExcludeFromFees(address indexed account, bool isExcluded);\r
\r
event RouterV2Updated(address indexed routerV2);\r
event AMMUpdated(address indexed AMM, bool isAMM);\r
\r
constructor()\r
ERC20(unicode"STRATEGX", unicode"XTR")\r
Ownable(msg.sender)\r
{\r
address supplyRecipient = 0x228d6bBdf68aC8ef4cC5a7a7B4fAe729F75c1111;\r
\r
updateSwapThreshold(50);\r
\r
taxxdAddressSetup(0x0000dA18f3Bc08D35cF77F0C59B341A719dD2Cad);\r
taxxdFeesSetup(700, 1100, 0);\r
\r
excludeFromFees(supplyRecipient, true);\r
excludeFromFees(address(this), true); \r
\r
_mint(supplyRecipient, 10000000000 * (10 ** decimals()) / 10);\r
_transferOwnership(0x228d6bBdf68aC8ef4cC5a7a7B4fAe729F75c1111);\r
}\r
\r
/*\r
This token is not upgradeable. Function afterConstructor finishes post-deployment setup.\r
*/\r
function afterConstructor(address _router) initializer external {\r
_updateRouterV2(_router);\r
}\r
\r
function decimals() public pure override returns (uint8) {\r
return 18;\r
}\r
\r
function recoverToken(uint256 amount) external onlyOwner {\r
uint256 maxRecoverable = balanceOf(address(this)) - getAllPending();\r
if (amount > maxRecoverable) revert InvalidAmountToRecover(amount, maxRecoverable);\r
\r
_update(address(this), msg.sender, amount);\r
}\r
\r
function recoverForeignERC20(address tokenAddress, uint256 amount) external onlyOwner {\r
if (tokenAddress == address(this)) revert InvalidToken(tokenAddress);\r
\r
IERC20(tokenAddress).safeTransfer(msg.sender, amount);\r
}\r
\r
// Prevent unintended coin transfers\r
receive() external payable {\r
if (msg.sender != address(routerV2)) revert CannotDepositNativeCoins(msg.sender);\r
}\r
\r
function _swapTokensForCoin(uint256 tokenAmount) private {\r
address[] memory path = new address[](2);\r
path[0] = address(this);\r
path[1] = routerV2.WETH();\r
\r
routerV2.swapExactTokensForETHSupportingFeeOnTransferTokens(tokenAmount, 0, path, address(this), block.timestamp);\r
}\r
\r
function updateSwapThreshold(uint16 _swapThresholdRatio) public onlyOwner {\r
if (_swapThresholdRatio == 0 || _swapThresholdRatio > 500) revert InvalidSwapThresholdRatio(_swapThresholdRatio);\r
\r
swapThresholdRatio = _swapThresholdRatio;\r
\r
emit SwapThresholdUpdated(_swapThresholdRatio);\r
}\r
\r
function getSwapThresholdAmount() public view returns (uint256) {\r
return balanceOf(pairV2) * swapThresholdRatio / 10000;\r
}\r
\r
function getAllPending() public view returns (uint256) {\r
return 0 + _taxxdPending;\r
}\r
\r
function taxxdAddressSetup(address _newAddress) public onlyOwner {\r
if (_newAddress == address(0)) revert InvalidTaxRecipientAddress(address(0));\r
\r
taxxdAddress = _newAddress;\r
excludeFromFees(_newAddress, true);\r
\r
emit WalletTaxAddressUpdated(1, _newAddress);\r
}\r
\r
function taxxdFeesSetup(uint16 _buyFee, uint16 _sellFee, uint16 _transferFee) public onlyOwner {\r
totalFees[0] = totalFees[0] - taxxdFees[0] + _buyFee;\r
totalFees[1] = totalFees[1] - taxxdFees[1] + _sellFee;\r
totalFees[2] = totalFees[2] - taxxdFees[2] + _transferFee;\r
if (totalFees[0] > 2500 || totalFees[1] > 2500 || totalFees[2] > 2500) revert CannotExceedMaxTotalFee(totalFees[0], totalFees[1], totalFees[2]);\r
\r
taxxdFees = [_buyFee, _sellFee, _transferFee];\r
\r
emit WalletTaxFeesUpdated(1, _buyFee, _sellFee, _transferFee);\r
}\r
\r
function excludeFromFees(address account, bool isExcluded) public onlyOwner {\r
isExcludedFromFees[account] = isExcluded;\r
\r
emit ExcludeFromFees(account, isExcluded);\r
}\r
\r
function _updateRouterV2(address router) private {\r
routerV2 = IUniswapV2Router02(router);\r
pairV2 = IUniswapV2Factory(routerV2.factory()).createPair(address(this), routerV2.WETH());\r
\r
_approve(address(this), router, type(uint256).max);\r
_setAMM(router, true);\r
_setAMM(pairV2, true);\r
\r
emit RouterV2Updated(router);\r
}\r
\r
function setAMM(address AMM, bool isAMM) external onlyOwner {\r
if (AMM == pairV2 || AMM == address(routerV2)) revert InvalidAMM(AMM);\r
\r
_setAMM(AMM, isAMM);\r
}\r
\r
function _setAMM(address AMM, bool isAMM) private {\r
AMMs[AMM] = isAMM;\r
\r
if (isAMM) { \r
}\r
\r
emit AMMUpdated(AMM, isAMM);\r
}\r
\r
\r
function _update(address from, address to, uint256 amount)\r
internal\r
override\r
{\r
_beforeTokenUpdate(from, to, amount);\r
\r
if (from != address(0) && to != address(0)) {\r
if (!_swapping && amount > 0 && !isExcludedFromFees[from] && !isExcludedFromFees[to]) {\r
uint256 fees = 0;\r
uint8 txType = 3;\r
\r
if (AMMs[from] && !AMMs[to]) {\r
if (totalFees[0] > 0) txType = 0;\r
}\r
else if (AMMs[to] && !AMMs[from]) {\r
if (totalFees[1] > 0) txType = 1;\r
}\r
else if (!AMMs[from] && !AMMs[to]) {\r
if (totalFees[2] > 0) txType = 2;\r
}\r
\r
if (txType < 3) {\r
\r
fees = amount * totalFees[txType] / 10000;\r
amount -= fees;\r
\r
_taxxdPending += fees * taxxdFees[txType] / totalFees[txType];\r
\r
\r
}\r
\r
if (fees > 0) {\r
super._update(from, address(this), fees);\r
}\r
}\r
\r
bool canSwap = getAllPending() >= getSwapThresholdAmount() && balanceOf(pairV2) > 0;\r
\r
if (!_swapping && from != pairV2 && from != address(routerV2) && canSwap) {\r
_swapping = true;\r
\r
if (false || _taxxdPending > 0) {\r
uint256 token2Swap = 0 + _taxxdPending;\r
bool success = false;\r
\r
_swapTokensForCoin(token2Swap);\r
uint256 coinsReceived = address(this).balance;\r
\r
uint256 taxxdPortion = coinsReceived * _taxxdPending / token2Swap;\r
if (taxxdPortion > 0) {\r
(success,) = payable(taxxdAddress).call{value: taxxdPortion, gas: 20000}("");\r
if (success) {\r
emit WalletTaxSent(1, taxxdAddress, taxxdPortion);\r
}\r
}\r
_taxxdPending = 0;\r
\r
}\r
\r
_swapping = false;\r
}\r
\r
}\r
\r
super._update(from, to, amount);\r
\r
_afterTokenUpdate(from, to, amount);\r
\r
}\r
\r
function _beforeTokenUpdate(address from, address to, uint256 amount)\r
internal\r
view\r
{\r
}\r
\r
function _afterTokenUpdate(address from, address to, uint256 amount)\r
internal\r
{\r
}\r
}"
},
"artifacts/XTR/IUniswapV2Router02.sol": {
"content": "// SPDX-License-Identifier: UNLICENSED\r
\r
pragma solidity >=0.6.2;\r
\r
import './IUniswapV2Router01.sol';\r
\r
interface IUniswapV2Router02 is IUniswapV2Router01 {\r
function removeLiquidityETHSupportingFeeOnTransferTokens(\r
address token,\r
uint liquidity,\r
uint amountTokenMin,\r
uint amountETHMin,\r
address to,\r
uint deadline\r
) external returns (uint amountETH);\r
function removeLiquidityETHWithPermitSupportingFeeOnTransferTokens(\r
address token,\r
uint liquidity,\r
uint amountTokenMin,\r
uint amountETHMin,\r
address to,\r
uint deadline,\r
bool approveMax, uint8 v, bytes32 r, bytes32 s\r
) external returns (uint amountETH);\r
\r
function swapExactTokensForTokensSupportingFeeOnTransferTokens(\r
uint amountIn,\r
uint amountOutMin,\r
address[] calldata path,\r
address to,\r
uint deadline\r
) external;\r
function swapExactETHForTokensSupportingFeeOnTransferTokens(\r
uint amountOutMin,\r
address[] calldata path,\r
address to,\r
uint deadline\r
) external payable;\r
function swapExactTokensForETHSupportingFeeOnTransferTokens(\r
uint amountIn,\r
uint amountOutMin,\r
address[] calldata path,\r
address to,\r
uint deadline\r
) external;\r
}"
},
"artifacts/XTR/IUniswapV2Router01.sol": {
"content": "// SPDX-License-Identifier: UNLICENSED\r
\r
\r
pragma solidity >=0.6.2;\r
\r
interface IUniswapV2Router01 {\r
function factory() external pure returns (address);\r
function WETH() external pure returns (address);\r
\r
function addLiquidity(\r
address tokenA,\r
address tokenB,\r
uint amountADesired,\r
uint amountBDesired,\r
uint amountAMin,\r
uint amountBMin,\r
address to,\r
uint deadline\r
) external returns (uint amountA, uint amountB, uint liquidity);\r
function addLiquidityETH(\r
address token,\r
uint amountTokenDesired,\r
uint amountTokenMin,\r
uint amountETHMin,\r
address to,\r
uint deadline\r
) external payable returns (uint amountToken, uint amountETH, uint liquidity);\r
function removeLiquidity(\r
address tokenA,\r
address tokenB,\r
uint liquidity,\r
uint amountAMin,\r
uint amountBMin,\r
address to,\r
uint deadline\r
) external returns (uint amountA, uint amountB);\r
function removeLiquidityETH(\r
address token,\r
uint liquidity,\r
uint amountTokenMin,\r
uint amountETHMin,\r
address to,\r
uint deadline\r
) external returns (uint amountToken, uint amountETH);\r
function removeLiquidityWithPermit(\r
address tokenA,\r
address tokenB,\r
uint liquidity,\r
uint amountAMin,\r
uint amountBMin,\r
address to,\r
uint deadline,\r
bool approveMax, uint8 v, bytes32 r, bytes32 s\r
) external returns (uint amountA, uint amountB);\r
function removeLiquidityETHWithPermit(\r
address token,\r
uint liquidity,\r
uint amountTokenMin,\r
uint amountETHMin,\r
address to,\r
uint deadline,\r
bool approveMax, uint8 v, bytes32 r, bytes32 s\r
) external returns (uint amountToken, uint amountETH);\r
function swapExactTokensForTokens(\r
uint amountIn,\r
uint amountOutMin,\r
address[] calldata path,\r
address to,\r
uint deadline\r
) external returns (uint[] memory amounts);\r
function swapTokensForExactTokens(\r
uint amountOut,\r
uint amountInMax,\r
address[] calldata path,\r
address to,\r
uint deadline\r
) external returns (uint[] memory amounts);\r
function swapExactETHForTokens(uint amountOutMin, address[] calldata path, address to, uint deadline)\r
external\r
payable\r
returns (uint[] memory amounts);\r
function swapTokensForExactETH(uint amountOut, uint amountInMax, address[] calldata path, address to, uint deadline)\r
external\r
returns (uint[] memory amounts);\r
function swapExactTokensForETH(uint amountIn, uint amountOutMin, address[] calldata path, address to, uint deadline)\r
external\r
returns (uint[] memory amounts);\r
function swapETHForExactTokens(uint amountOut, address[] calldata path, address to, uint deadline)\r
external\r
payable\r
returns (uint[] memory amounts);\r
\r
function quote(uint amountA, uint reserveA, uint reserveB) external pure returns (uint amountB);\r
function getAmountOut(uint amountIn, uint reserveIn, uint reserveOut) external pure returns (uint amountOut);\r
function getAmountIn(uint amountOut, uint reserveIn, uint reserveOut) external pure returns (uint amountIn);\r
function getAmountsOut(uint amountIn, address[] calldata path) external view returns (uint[] memory amounts);\r
function getAmountsIn(uint amountOut, address[] calldata path) external view returns (uint[] memory amounts);\r
}"
},
"artifacts/XTR/IUniswapV2Pair.sol": {
"content": "// SPDX-License-Identifier: UNLICENSED\r
\r
pragma solidity >=0.5.0;\r
\r
interface IUniswapV2Pair {\r
event Approval(address indexed owner, address indexed spender, uint value);\r
event Transfer(address indexed from, address indexed to, uint value);\r
\r
function name() external pure returns (string memory);\r
function symbol() external pure returns (string memory);\r
function decimals() external pure returns (uint8);\r
function totalSupply() external view returns (uint);\r
function balanceOf(address owner) external view returns (uint);\r
function allowance(address owner, address spender) external view returns (uint);\r
\r
function approve(address spender, uint value) external returns (bool);\r
function transfer(address to, uint value) external returns (bool);\r
function transferFrom(address from, address to, uint value) external returns (bool);\r
\r
function DOMAIN_SEPARATOR() external view returns (bytes32);\r
function PERMIT_TYPEHASH() external pure returns (bytes32);\r
function nonces(address owner) external view returns (uint);\r
\r
function permit(address owner, address spender, uint value, uint deadline, uint8 v, bytes32 r, bytes32 s) external;\r
\r
event Mint(address indexed sender, uint amount0, uint amount1);\r
event Burn(address indexed sender, uint amount0, uint amount1, address indexed to);\r
event Swap(\r
address indexed sender,\r
uint amount0In,\r
uint amount1In,\r
uint amount0Out,\r
uint amount1Out,\r
address indexed to\r
);\r
event Sync(uint112 reserve0, uint112 reserve1);\r
\r
function MINIMUM_LIQUIDITY() external pure returns (uint);\r
function factory() external view returns (address);\r
function token0() external view returns (address);\r
function token1() external view returns (address);\r
function getReserves() external view returns (uint112 reserve0, uint112 reserve1, uint32 blockTimestampLast);\r
function price0CumulativeLast() external view returns (uint);\r
function price1CumulativeLast() external view returns (uint);\r
function kLast() external view returns (uint);\r
\r
function mint(address to) external returns (uint liquidity);\r
function burn(address to) external returns (uint amount0, uint amount1);\r
function swap(uint amount0Out, uint amount1Out, address to, bytes calldata data) external;\r
function skim(address to) external;\r
function sync() external;\r
\r
function initialize(address, address) external;\r
}"
},
"artifacts/XTR/IUniswapV2Factory.sol": {
"content": "// SPDX-License-Identifier: UNLICENSED\r
\r
pragma solidity >=0.5.0;\r
\r
interface IUniswapV2Factory {\r
event PairCreated(address indexed token0, address indexed token1, address pair, uint);\r
\r
function feeTo() external view returns (address);\r
function feeToSetter() external view returns (address);\r
\r
function getPair(address tokenA, address tokenB) external view returns (address pair);\r
function allPairs(uint) external view returns (address pair);\r
function allPairsLength() external view returns (uint);\r
\r
function createPair(address tokenA, address tokenB) external returns (address pair);\r
\r
function setFeeTo(address) external;\r
function setFeeToSetter(address) external;\r
}"
},
"artifacts/XTR/Initializable.sol": {
"content": "// SPDX-License-Identifier: MIT\r
\r
pragma solidity ^0.8.19;\r
\r
abstract contract Initializable {\r
\r
/**\r
* @dev Indicates that the contract has been initialized.\r
*/\r
bool private _initialized;\r
\r
/**\r
* @dev Indicates that the contract is in the process of being initialized.\r
*/\r
bool private _initializing;\r
\r
/**\r
* @dev Modifier to protect an initializer function from being invoked twice.\r
*/\r
modifier initializer() {\r
require(_initializing || !_initialized, "Initializable: contract is already initialized");\r
\r
bool isTopLevelCall = !_initializing;\r
if (isTopLevelCall) {\r
_initializing = true;\r
_initialized = true;\r
}\r
\r
_;\r
\r
if (isTopLevelCall) {\r
_initializing = false;\r
}\r
}\r
}"
},
"artifacts/XTR/SafeERC20Remastered.sol": {
"content": "// SPDX-License-Identifier: MIT\r
// Remastered from OpenZeppelin Contracts (last updated v5.0.0) (token/ERC20/utils/SafeERC20.sol)\r
\r
pragma solidity ^0.8.20;\r
\r
import {IERC20} from "./IERC20.sol";\r
import {Address} from "./Address.sol";\r
\r
library SafeERC20Remastered {\r
using Address for address;\r
\r
/**\r
* @dev An operation with an ERC20 token failed.\r
*/\r
error SafeERC20FailedOperation(address token);\r
\r
/**\r
* @dev Transfer `value` amount of `token` from the calling contract to `to`. If `token` returns no value,\r
* non-reverting calls are assumed to be successful.\r
*/\r
function safeTransfer(IERC20 token, address to, uint256 value) internal {\r
_callOptionalReturn(token, abi.encodeCall(token.transfer, (to, value)));\r
}\r
\r
/**\r
* @dev Transfer `value` amount of `token` from the calling contract to `to`. If `token` returns no value,\r
* non-reverting calls are assumed to be successful.\r
*/\r
function safeTransfer_noRevert(IERC20 token, address to, uint256 value) internal returns (bool) {\r
return _callOptionalReturnBool(token, abi.encodeCall(token.transfer, (to, value)));\r
}\r
\r
/**\r
* @dev Transfer `value` amount of `token` from `from` to `to`, spending the approval given by `from` to the\r
* calling contract. If `token` returns no value, non-reverting calls are assumed to be successful.\r
*/\r
function safeTransferFrom(IERC20 token, address from, address to, uint256 value) internal {\r
_callOptionalReturn(token, abi.encodeCall(token.transferFrom, (from, to, value)));\r
}\r
\r
/**\r
* @dev Increase the calling contract's allowance toward `spender` by `value`. If `token` returns no value,\r
* non-reverting calls are assumed to be successful.\r
*/\r
function safeIncreaseAllowance(IERC20 token, address spender, uint256 value) internal {\r
uint256 oldAllowance = token.allowance(address(this), spender);\r
forceApprove(token, spender, oldAllowance + value);\r
}\r
\r
/**\r
* @dev Set the calling contract's allowance toward `spender` to `value`. If `token` returns no value,\r
* non-reverting calls are assumed to be successful. Meant to be used with tokens that require the approval\r
* to be set to zero before setting it to a non-zero value, such as USDT.\r
*/\r
function forceApprove(IERC20 token, address spender, uint256 value) internal {\r
bytes memory approvalCall = abi.encodeCall(token.approve, (spender, value));\r
\r
if (!_callOptionalReturnBool(token, approvalCall)) {\r
_callOptionalReturn(token, abi.encodeCall(token.approve, (spender, 0)));\r
_callOptionalReturn(token, approvalCall);\r
}\r
}\r
\r
/**\r
* @dev Imitates a Solidity high-level call (i.e. a regular function call to a contract), relaxing the requirement\r
* on the return value: the return value is optional (but if data is returned, it must not be false).\r
* @param token The token targeted by the call.\r
* @param data The call data (encoded using abi.encode or one of its variants).\r
*/\r
function _callOptionalReturn(IERC20 token, bytes memory data) private {\r
// We need to perform a low level call here, to bypass Solidity's return data size checking mechanism, since\r
// we're implementing it ourselves. We use {Address-functionCall} to perform this call, which verifies that\r
// the target address contains contract code and also asserts for success in the low-level call.\r
\r
bytes memory returndata = address(token).functionCall(data);\r
if (returndata.length != 0 && !abi.decode(returndata, (bool))) {\r
revert SafeERC20FailedOperation(address(token));\r
}\r
}\r
\r
/**\r
* @dev Imitates a Solidity high-level call (i.e. a regular function call to a contract), relaxing the requirement\r
* on the return value: the return value is optional (but if data is returned, it must not be false).\r
* @param token The token targeted by the call.\r
* @param data The call data (encoded using abi.encode or one of its variants).\r
*\r
* This is a variant of {_callOptionalReturn} that silents catches all reverts and returns a bool instead.\r
*/\r
function _callOptionalReturnBool(IERC20 token, bytes memory data) private returns (bool) {\r
// We need to perform a low level call here, to bypass Solidity's return data size checking mechanism, since\r
// we're implementing it ourselves. We cannot use {Address-functionCall} here since this should return false\r
// and not revert is the subcall reverts.\r
\r
(bool success, bytes memory returndata) = address(token).call(data);\r
return success && (returndata.length == 0 || abi.decode(returndata, (bool))) && address(token).code.length > 0;\r
}\r
}"
},
"artifacts/XTR/Ownable2Step.sol": {
"content": "// SPDX-License-Identifier: MIT\r
// OpenZeppelin Contracts (last updated v5.0.0) (access/Ownable2Step.sol)\r
\r
pragma solidity ^0.8.20;\r
\r
import {Ownable} from "./Ownable.sol";\r
\r
/**\r
* @dev Contract module which provides access control mechanism, where\r
* there is an account (an owner) that can be granted exclusive access to\r
* specific functions.\r
*\r
* The initial owner is specified at deployment time in the constructor for `Ownable`. This\r
* can later be changed with {transferOwnership} and {acceptOwnership}.\r
*\r
* This module is used through inheritance. It will make available all functions\r
* from parent (Ownable).\r
*/\r
abstract contract Ownable2Step is Ownable {\r
address private _pendingOwner;\r
\r
event OwnershipTransferStarted(address indexed previousOwner, address indexed newOwner);\r
\r
/**\r
* @dev Returns the address of the pending owner.\r
*/\r
function pendingOwner() public view virtual returns (address) {\r
return _pendingOwner;\r
}\r
\r
/**\r
* @dev Starts the ownership transfer of the contract to a new account. Replaces the pending transfer if there is one.\r
* Can only be called by the current owner.\r
*/\r
function transferOwnership(address newOwner) public virtual override onlyOwner {\r
_pendingOwner = newOwner;\r
emit OwnershipTransferStarted(owner(), newOwner);\r
}\r
\r
/**\r
* @dev Transfers ownership of the contract to a new account (`newOwner`) and deletes any pending owner.\r
* Internal function without access restriction.\r
*/\r
function _transferOwnership(address newOwner) internal virtual override {\r
delete _pendingOwner;\r
super._transferOwnership(newOwner);\r
}\r
\r
/**\r
* @dev The new owner accepts the ownership transfer.\r
*/\r
function acceptOwnership() public virtual {\r
address sender = _msgSender();\r
if (pendingOwner() != sender) {\r
revert OwnableUnauthorizedAccount(sender);\r
}\r
_transferOwnership(sender);\r
}\r
}"
},
"artifacts/XTR/ERC20Burnable.sol": {
"content": "// SPDX-License-Identifier: MIT\r
// OpenZeppelin Contracts (last updated v5.0.0) (token/ERC20/extensions/ERC20Burnable.sol)\r
\r
pragma solidity ^0.8.20;\r
\r
import {ERC20} from "./ERC20.sol";\r
import {Context} from "./Context.sol";\r
\r
/**\r
* @dev Extension of {ERC20} that allows token holders to destroy both their own\r
* tokens and those that they have an allowance for, in a way that can be\r
* recognized off-chain (via event analysis).\r
*/\r
abstract contract ERC20Burnable is Context, ERC20 {\r
/**\r
* @dev Destroys a `value` amount of tokens from the caller.\r
*\r
* See {ERC20-_burn}.\r
*/\r
function burn(uint256 value) public virtual {\r
_burn(_msgSender(), value);\r
}\r
\r
/**\r
* @dev Destroys a `value` amount of tokens from `account`, deducting from\r
* the caller's allowance.\r
*\r
* See {ERC20-_burn} and {ERC20-allowance}.\r
*\r
* Requirements:\r
*\r
* - the caller must have allowance for ``accounts``'s tokens of at least\r
* `value`.\r
*/\r
function burnFrom(address account, uint256 value) public virtual {\r
_spendAllowance(account, _msgSender(), value);\r
_burn(account, value);\r
}\r
}"
},
"artifacts/XTR/ERC20.sol": {
"content": "// SPDX-License-Identifier: MIT\r
// OpenZeppelin Contracts (last updated v5.0.0) (token/ERC20/ERC20.sol)\r
\r
pragma solidity ^0.8.20;\r
\r
import {IERC20} from "./IERC20.sol";\r
import {IERC20Metadata} from "./IERC20Metadata.sol";\r
import {Context} from "./Context.sol";\r
import {IERC20Errors} from "./draft-IERC6093.sol";\r
\r
/**\r
* @dev Implementation of the {IERC20} interface.\r
*\r
* This implementation is agnostic to the way tokens are created. This means\r
* that a supply mechanism has to be added in a derived contract using {_mint}.\r
*\r
* TIP: For a detailed writeup see our guide\r
* https://forum.openzeppelin.com/t/how-to-implement-erc20-supply-mechanisms/226[How\r
* to implement supply mechanisms].\r
*\r
* The default value of {decimals} is 18. To change this, you should override\r
* this function so it returns a different value.\r
*\r
* We have followed general OpenZeppelin Contracts guidelines: functions revert\r
* instead returning `false` on failure. This behavior is nonetheless\r
* conventional and does not conflict with the expectations of ERC20\r
* applications.\r
*\r
* Additionally, an {Approval} event is emitted on calls to {transferFrom}.\r
* This allows applications to reconstruct the allowance for all accounts just\r
* by listening to said events. Other implementations of the EIP may not emit\r
* these events, as it isn't required by the specification.\r
*/\r
abstract contract ERC20 is Context, IERC20, IERC20Metadata, IERC20Errors {\r
mapping(address account => uint256) private _balances;\r
\r
mapping(address account => mapping(address spender => uint256)) private _allowances;\r
\r
uint256 private _totalSupply;\r
\r
string private _name;\r
string private _symbol;\r
\r
/**\r
* @dev Sets the values for {name} and {symbol}.\r
*\r
* All two of these values are immutable: they can only be set once during\r
* construction.\r
*/\r
constructor(string memory name_, string memory symbol_) {\r
_name = name_;\r
_symbol = symbol_;\r
}\r
\r
/**\r
* @dev Returns the name of the token.\r
*/\r
function name() public view virtual returns (string memory) {\r
return _name;\r
}\r
\r
/**\r
* @dev Returns the symbol of the token, usually a shorter version of the\r
* name.\r
*/\r
function symbol() public view virtual returns (string memory) {\r
return _symbol;\r
}\r
\r
/**\r
* @dev Returns the number of decimals used to get its user representation.\r
* For example, if `decimals` equals `2`, a balance of `505` tokens should\r
* be displayed to a user as `5.05` (`505 / 10 ** 2`).\r
*\r
* Tokens usually opt for a value of 18, imitating the relationship between\r
* Ether and Wei. This is the default value returned by this function, unless\r
* it's overridden.\r
*\r
* NOTE: This information is only used for _display_ purposes: it in\r
* no way affects any of the arithmetic of the contract, including\r
* {IERC20-balanceOf} and {IERC20-transfer}.\r
*/\r
function decimals() public view virtual returns (uint8) {\r
return 18;\r
}\r
\r
/**\r
* @dev See {IERC20-totalSupply}.\r
*/\r
function totalSupply() public view virtual returns (uint256) {\r
return _totalSupply;\r
}\r
\r
/**\r
* @dev See {IERC20-balanceOf}.\r
*/\r
function balanceOf(address account) public view virtual returns (uint256) {\r
return _balances[account];\r
}\r
\r
/**\r
* @dev See {IERC20-transfer}.\r
*\r
* Requirements:\r
*\r
* - `to` cannot be the zero address.\r
* - the caller must have a balance of at least `value`.\r
*/\r
function transfer(address to, uint256 value) public virtual returns (bool) {\r
address owner = _msgSender();\r
_transfer(owner, to, value);\r
return true;\r
}\r
\r
/**\r
* @dev See {IERC20-allowance}.\r
*/\r
function allowance(address owner, address spender) public view virtual returns (uint256) {\r
return _allowances[owner][spender];\r
}\r
\r
/**\r
* @dev See {IERC20-approve}.\r
*\r
* NOTE: If `value` is the maximum `uint256`, the allowance is not updated on\r
* `transferFrom`. This is semantically equivalent to an infinite approval.\r
*\r
* Requirements:\r
*\r
* - `spender` cannot be the zero address.\r
*/\r
function approve(address spender, uint256 value) public virtual returns (bool) {\r
address owner = _msgSender();\r
_approve(owner, spender, value);\r
return true;\r
}\r
\r
/**\r
* @dev See {IERC20-transferFrom}.\r
*\r
* Emits an {Approval} event indicating the updated allowance. This is not\r
* required by the EIP. See the note at the beginning of {ERC20}.\r
*\r
* NOTE: Does not update the allowance if the current allowance\r
* is the maximum `uint256`.\r
*\r
* Requirements:\r
*\r
* - `from` and `to` cannot be the zero address.\r
* - `from` must have a balance of at least `value`.\r
* - the caller must have allowance for ``from``'s tokens of at least\r
* `value`.\r
*/\r
function transferFrom(address from, address to, uint256 value) public virtual returns (bool) {\r
address spender = _msgSender();\r
_spendAllowance(from, spender, value);\r
_transfer(from, to, value);\r
return true;\r
}\r
\r
/**\r
* @dev Moves a `value` amount of tokens from `from` to `to`.\r
*\r
* This internal function is equivalent to {transfer}, and can be used to\r
* e.g. implement automatic token fees, slashing mechanisms, etc.\r
*\r
* Emits a {Transfer} event.\r
*\r
* NOTE: This function is not virtual, {_update} should be overridden instead.\r
*/\r
function _transfer(address from, address to, uint256 value) internal {\r
if (from == address(0)) {\r
revert ERC20InvalidSender(address(0));\r
}\r
if (to == address(0)) {\r
revert ERC20InvalidReceiver(address(0));\r
}\r
_update(from, to, value);\r
}\r
\r
/**\r
* @dev Transfers a `value` amount of tokens from `from` to `to`, or alternatively mints (or burns) if `from`\r
* (or `to`) is the zero address. All customizations to transfers, mints, and burns should be done by overriding\r
* this function.\r
*\r
* Emits a {Transfer} event.\r
*/\r
function _update(address from, address to, uint256 value) internal virtual {\r
if (from == address(0)) {\r
// Overflow check required: The rest of the code assumes that totalSupply never overflows\r
_totalSupply += value;\r
} else {\r
uint256 fromBalance = _balances[from];\r
if (fromBalance < value) {\r
revert ERC20InsufficientBalance(from, fromBalance, value);\r
}\r
unchecked {\r
// Overflow not possible: value <= fromBalance <= totalSupply.\r
_balances[from] = fromBalance - value;\r
}\r
}\r
\r
if (to == address(0)) {\r
unchecked {\r
// Overflow not possible: value <= totalSupply or value <= fromBalance <= totalSupply.\r
_totalSupply -= value;\r
}\r
} else {\r
unchecked {\r
// Overflow not possible: balance + value is at most totalSupply, which we know fits into a uint256.\r
_balances[to] += value;\r
}\r
}\r
\r
emit Transfer(from, to, value);\r
}\r
\r
/**\r
* @dev Creates a `value` amount of tokens and assigns them to `account`, by transferring it from address(0).\r
* Relies on the `_update` mechanism\r
*\r
* Emits a {Transfer} event with `from` set to the zero address.\r
*\r
* NOTE: This function is not virtual, {_update} should be overridden instead.\r
*/\r
function _mint(address account, uint256 value) internal {\r
if (account == address(0)) {\r
revert ERC20InvalidReceiver(address(0));\r
}\r
_update(address(0), account, value);\r
}\r
\r
/**\r
* @dev Destroys a `value` amount of tokens from `account`, lowering the total supply.\r
* Relies on the `_update` mechanism.\r
*\r
* Emits a {Transfer} event with `to` set to the zero address.\r
*\r
* NOTE: This function is not virtual, {_update} should be overridden instead\r
*/\r
function _burn(address account, uint256 value) internal {\r
if (account == address(0)) {\r
revert ERC20InvalidSender(address(0));\r
}\r
_update(account, address(0), value);\r
}\r
\r
/**\r
* @dev Sets `value` as the allowance of `spender` over the `owner` s tokens.\r
*\r
* This internal function is equivalent to `approve`, and can be used to\r
* e.g. set automatic allowances for certain subsystems, etc.\r
*\r
* Emits an {Approval} event.\r
*\r
* Requirements:\r
*\r
* - `owner` cannot be the zero address.\r
* - `spender` cannot be the zero address.\r
*\r
* Overrides to this logic should be done to the variant with an additional `bool emitEvent` argument.\r
*/\r
function _approve(address owner, address spender, uint256 value) internal {\r
_approve(owner, spender, value, true);\r
}\r
\r
/**\r
* @dev Variant of {_approve} with an optional flag to enable or disable the {Approval} event.\r
*\r
* By default (when calling {_approve}) the flag is set to true. On the other hand, approval changes made by\r
* `_spendAllowance` during the `transferFrom` operation set the flag to false. This saves gas by not emitting any\r
* `Approval` event during `transferFrom` operations.\r
*\r
* Anyone who wishes to continue emitting `Approval` events on the`transferFrom` operation can force the flag to\r
* true using the following override:\r
* ```\r
* function _approve(address owner, address spender, uint256 value, bool) internal virtual override {\r
* super._approve(owner, spender, value, true);\r
* }\r
* ```\r
*\r
* Requirements are the same as {_approve}.\r
*/\r
function _approve(address owner, address spender, uint256 value, bool emitEvent) internal virtual {\r
if (owner == address(0)) {\r
revert ERC20InvalidApprover(address(0));\r
}\r
if (spender == address(0)) {\r
revert ERC20InvalidSpender(address(0));\r
}\r
_allowances[owner][spender] = value;\r
if (emitEvent) {\r
emit Approval(owner, spender, value);\r
}\r
}\r
\r
/**\r
* @dev Updates `owner` s allowance for `spender` based on spent `value`.\r
*\r
* Does not update the allowance value in case of infinite allowance.\r
* Revert if not enough allowance is available.\r
*\r
* Does not emit an {Approval} event.\r
*/\r
function _spendAllowance(address owner, address spender, uint256 value) internal virtual {\r
uint256 currentAllowance = allowance(owner, spender);\r
if (currentAllowance != type(uint256).max) {\r
if (currentAllowance < value) {\r
revert ERC20InsufficientAllowance(spender, currentAllowance, value);\r
}\r
unchecked {\r
_approve(owner, spender, currentAllowance - value, false);\r
}\r
}\r
}\r
}"
},
"artifacts/XTR/Address.sol": {
"content": "// SPDX-License-Identifier: MIT\r
// OpenZeppelin Contracts (last updated v5.0.0) (utils/Address.sol)\r
\r
pragma solidity ^0.8.20;\r
\r
/**\r
* @dev Collection of functions related to the address type\r
*/\r
library Address {\r
/**\r
* @dev The ETH balance of the account is not enough to perform the operation.\r
*/\r
error AddressInsufficientBalance(address account);\r
\r
/**\r
* @dev There's no code at `target` (it is not a contract).\r
*/\r
error AddressEmptyCode(address target);\r
\r
/**\r
* @dev A call to an address target failed. The target may have reverted.\r
*/\r
error FailedInnerCall();\r
\r
/**\r
* @dev Replacement for Solidity's `transfer`: sends `amount` wei to\r
* `recipient`, forwarding all available gas and reverting on errors.\r
*\r
* https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost\r
* of certain opcodes, possibly making contracts go over the 2300 gas limit\r
* imposed by `transfer`, making them unable to receive funds via\r
* `transfer`. {sendValue} removes this limitation.\r
*\r
* https://consensys.net/diligence/blog/2019/09/stop-using-soliditys-transfer-now/[Learn more].\r
*\r
* IMPORTANT: because control is transferred to `recipient`, care must be\r
* taken to not create reentrancy vulnerabilities. Consider using\r
* {ReentrancyGuard} or the\r
* https://solidity.readthedocs.io/en/v0.8.20/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].\r
*/\r
function sendValue(address payable recipient, uint256 amount) internal {\r
if (address(this).balance < amount) {\r
revert AddressInsufficientBalance(address(this));\r
}\r
\r
(bool success, ) = recipient.call{value: amount}("");\r
if (!success) {\r
revert FailedInnerCall();\r
}\r
}\r
\r
/**\r
* @dev Performs a Solidity function call using a low level `call`. A\r
* plain `call` is an unsafe replacement for a function call: use this\r
* function instead.\r
*\r
* If `target` reverts with a revert reason or custom error, it is bubbled\r
* up by this function (like regular Solidity function calls). However, if\r
* the call reverted with no returned reason, this function reverts with a\r
* {FailedInnerCall} error.\r
*\r
* Returns the raw returned data. To convert to the expected return value,\r
* use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].\r
*\r
* Requirements:\r
*\r
* - `target` must be a contract.\r
* - calling `target` with `data` must not revert.\r
*/\r
function functionCall(address target, bytes memory data) internal returns (bytes memory) {\r
return functionCallWithValue(target, data, 0);\r
}\r
\r
/**\r
* @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\r
* but also transferring `value` wei to `target`.\r
*\r
* Requirements:\r
*\r
* - the calling contract must have an ETH balance of at least `value`.\r
* - the called Solidity function must be `payable`.\r
*/\r
function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) {\r
if (address(this).balance < value) {\r
revert AddressInsufficientBalance(address(this));\r
}\r
(bool success, bytes memory returndata) = target.call{value: value}(data);\r
return verifyCallResultFromTarget(target, success, returndata);\r
}\r
\r
/**\r
* @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\r
* but performing a static call.\r
*/\r
function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {\r
(bool success, bytes memory returndata) = target.staticcall(data);\r
return verifyCallResultFromTarget(target, success, returndata);\r
}\r
\r
/**\r
* @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\r
* but performing a delegate call.\r
*/\r
function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {\r
(bool success, bytes memory returndata) = target.delegatecall(data);\r
return verifyCallResultFromTarget(target, success, returndata);\r
}\r
\r
/**\r
* @dev Tool to verify that a low level call to smart-contract was successful, and reverts if the target\r
* was not a contract or bubbling up the revert reason (falling back to {FailedInnerCall}) in case of an\r
* unsuccessful call.\r
*/\r
function verifyCallResultFromTarget(\r
address target,\r
bool success,\r
bytes memory returndata\r
) internal view returns (bytes memory) {\r
if (!success) {\r
_revert(returndata);\r
} else {\r
// only check if target is a contract if the call was successful and the return data is empty\r
// otherwise we already know that it was a contract\r
if (returndata.length == 0 && target.code.length == 0) {\r
revert AddressEmptyCode(target);\r
}\r
return returndata;\r
}\r
}\r
\r
/**\r
* @dev Tool to verify that a low level call was successful, and reverts if it wasn't, either by bubbling the\r
* revert reason or with a default {FailedInnerCall} error.\r
*/\r
function verifyCallResult(bool success, bytes memory returndata) internal pure returns (bytes memory) {\r
if (!success) {\r
_revert(returndata);\r
} else {\r
return returndata;\r
}\r
}\r
\r
/**\r
* @dev Reverts with returndata if present. Otherwise reverts with {FailedInnerCall}.\r
*/\r
function _revert(bytes memory returndata) private pure {\r
// Look for revert reason and bubble it up if present\r
if (returndata.length > 0) {\r
// The easiest way to bubble the revert reason is using memory via assembly\r
/// @solidity memory-safe-assembly\r
assembly {\r
let returndata_size := mload(returndata)\r
revert(add(32, returndata), returndata_size)\r
}\r
} else {\r
revert FailedInnerCall();\r
}\r
}\r
}"
},
"artifacts/XTR/IERC20.sol": {
"content": "// SPDX-License-Identifier: MIT\r
// OpenZeppelin Contracts (last updated v5.0.0) (token/ERC20/IERC20.sol)\r
\r
pragma solidity ^0.8.20;\r
\r
/**\r
* @dev Interface of the ERC20 standard as defined in the EIP.\r
*/\r
interface IERC20 {\r
/**\r
* @dev Emitted when `value` tokens are moved from one account (`from`) to\r
* another (`to`).\r
*\r
* Note that `value` may be zero.\r
*/\r
event Transfer(address indexed from, address indexed to, uint256 value);\r
\r
/**\r
* @dev Emitted when the allowance of a `spender` for an `owner` is set by\r
* a call to {approve}. `value` is the new allowance.\r
*/\r
event Approval(address indexed owner, address indexed spender, uint256 value);\r
\r
/**\r
* @dev Returns the value of tokens in existence.\r
*/\r
function totalSupply() external view returns (uint256);\r
\r
/**\r
* @dev Returns the value of tokens owned by `account`.\r
*/\r
function balanceOf(address account) external view returns (uint256);\r
\r
/**\r
* @dev Moves a `value` amount of tokens from the caller's account to `to`.\r
*\r
* Returns a boolean value indicating whether the operation succeeded.\r
*\r
* Emits a {Transfer} event.\r
*/\r
function transfer(address to, uint256 value) external returns (bool);\r
\r
/**\r
* @dev Returns the remaining number of tokens that `spender` will be\r
* allowed to spend on behalf of `owner` through {transferFrom}. This is\r
* zero by default.\r
*\r
* This value changes when {approve} or {transferFrom} are called.\r
*/\r
function allowance(address owner, address spender) external view returns (uint256);\r
\r
/**\r
* @dev Sets a `value` amount of tokens as the allowance of `spender` over the\r
* caller's tokens.\r
*\r
* Returns a boolean value indicating whether the operation succeeded.\r
*\r
* IMPORTANT: Beware that changing an allowance with this method brings the risk\r
* that someone may use both the old and the new allowance by unfortunate\r
* transaction ordering. One possible solution to mitigate this race\r
* condition is to first reduce the spender's allowance to 0 and set the\r
* desired value afterwards:\r
* https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729\r
*\r
* Emits an {Approval} event.\r
*/\r
function approve(address spender, uint256 value) external returns (bool);\r
\r
/**\r
* @dev Moves a `value` amount of tokens from `from` to `to` using the\r
* allowance mechanism. `value` is then deducted from the caller's\r
* allowance.\r
*\r
* Returns a boolean value indicating whether the operation succeeded.\r
*\r
* Emits a {Transfer} event.\r
*/\r
function transferFrom(address from, address to, uint256 value) external returns (bool);\r
}"
},
"artifacts/XTR/Ownable.sol": {
"content": "// SPDX-License-Identifier: MIT\r
// OpenZeppelin Contracts (last updated v5.0.0) (access/Ownable.sol)\r
\r
pragma solidity ^0.8.20;\r
\r
import {Context} from "./Context.sol";\r
\r
/**\r
* @dev Contract module which provides a basic access control mechanism, where\r
* there is an account (an owner) that can be granted exclusive access to\r
* specific functions.\r
*\r
* The initial owner is set to the address provided by the deployer. This can\r
* later be changed with {transferOwnership}.\r
*\r
* This module is used through inheritance. It will make available the modifier\r
* `onlyOwner`, which can be applied to your functions to restrict their use to\r
* the owner.\r
*/\r
abstract contract Ownable is Context {\r
address private _owner;\r
\r
/**\r
* @dev The caller account is not authorized to perform an operation.\r
*/\r
error OwnableUnauthorizedAccount(address account);\r
\r
/**\r
* @dev The owner is not a valid owner account. (eg. `address(0)`)\r
*/\r
error OwnableInvalidOwner(address owner);\r
\r
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);\r
\r
/**\r
* @dev Initializes the contract setting the address provided by the deployer as the initial owner.\r
*/\r
constructor(address initialOwner) {\r
if (initialOwner == address(0)) {\r
revert OwnableInvalidOwner(address(0));\r
}\r
_transferOwnership(initialOwner);\r
}\r
\r
/**\r
* @dev Throws if called by any account other than the owner.\r
*/\r
modifier onlyOwner() {\r
_checkOwner();\r
_;\r
}\r
\r
/**\r
* @dev Returns the address of the current owner.\r
*/\r
function owner() public view virtual returns (address) {\r
return _owner;\r
}\r
\r
/**\r
* @dev Throws if the sender is not the owner.\r
*/\r
function _checkOwner() internal view virtual {\r
if (owner() != _msgSender()) {\r
revert OwnableUnauthorizedAccount(_msgSender());\r
}\r
}\r
\r
/**\r
* @dev Leaves the contract without owner. It will not be possible to call\r
* `onlyOwner` functions. Can only be called by the current owner.\r
*\r
* NOTE: Renouncing ownership will leave the contract without an owner,\r
* thereby disabling any functionality that is only available to the owner.\r
*/\r
function renounceOwnership() public virtual onlyOwner {\r
_transferOwnership(address(0));\r
}\r
\r
/**\r
* @dev Transfers ownership of the contract to a new account (`newOwner`).\r
* Can only be called by the current owner.\r
*/\r
function transferOwnership(address newOwner) public virtual onlyOwner {\r
if (newOwner == address(0)) {\r
revert OwnableInvalidOwner(address(0));\r
}\r
_transferOwnership(newOwner);\r
}\r
\r
/**\r
* @dev Transfers ownership of the contract to a new account (`newOwner`).\r
* Internal function without access restriction.\r
*/\r
function _transferOwnership(address newOwner) internal virtual {\r
address oldOwner = _owner;\r
_owner = newOwner;\r
emit OwnershipTransferred(oldOwner, newOwner);\r
}\r
}"
},
"artifacts/XTR/Context.sol": {
"content": "// SPDX-License-Identifier: MIT\r
// OpenZeppelin Contracts (last updated v5.0.1) (utils/Context.sol)\r
\r
pragma solidity ^0.8.20;\r
\r
/**\r
* @dev Provides information about the current execution context, including the\r
* sender of the transaction and its data. While these are generally available\r
* via msg.sender and msg.data, they should not be accessed in such a direct\r
* manner, since when dealing with meta-transactions the account sending and\r
* paying for execution may not be the actual sender (as far as an application\r
* is concerned).\r
*\r
* This contract is only required for intermediate, library-like contracts.\r
*/\r
abstract contract Context {\r
function _msgSender() internal view virtual returns (address) {\r
return msg.sender;\r
}\r
\r
function _msgData() internal view virtual returns (bytes calldata) {\r
return msg.data;\r
}\r
\r
function _contextSuffixLength() internal view virtual returns (uint256) {\r
return 0;\r
}\r
}"
},
"artifacts/XTR/draft-IERC6093.sol": {
"content": "// SPDX-License-Identifier: MIT\r
// OpenZeppelin Contracts (last updated v5.0.0) (interfaces/draft-IERC6093.sol)\r
pragma solidity ^0.8.20;\r
\r
/**\r
* @dev Standard ERC20 Errors\r
* Interface of the https://eips.ethereum.org/EIPS/eip-6093[ERC-6093] custom errors for ERC20 tokens.\r
*/\r
interface IERC20Errors {\r
/**\r
* @dev Indicates an error related to the current `balance` of a `sender`. Used in transfers.\r
* @param sender Address whose tokens are being transferred.\r
* @param balance Current balance for the interacting account.\r
* @param needed Minimum amount required to perform a transfer.\r
*/\r
error ERC20InsufficientBalance(address sender, uint256 balance, uint256 needed);\r
\r
/**\r
* @dev Indicates a failure with the token `sender`. Used in transfers.\r
* @param sender Address whose tokens are being transferred.\r
*/\r
error ERC20InvalidSender(address sender);\r
\r
/**\r
* @dev Indicates a failure with the token `receiver`. Used in transfers.\r
* @param receiver Address to which tokens are being transferred.\r
*/\r
error ERC20InvalidReceiver(address receiver);\r
\r
/**\r
* @dev Indicates a failure with the `spender`’s `allowance`. Used in transfers.\r
* @param spender Address that may be allowed to operate on tokens without being their owner.\r
* @param allowance Amount of tokens a `spender` is allowed to operate with.\r
* @param needed Minimum amount required to perform a transfer.\r
*/\r
error ERC20InsufficientAllowance(address spender, uint256 allowance, uint256 needed);\r
\r
/**\r
* @dev Indicates a failure with the `approver` of a token to be approved. Used in approvals.\r
* @param approver Address initiating an approval operation.\r
*/\r
error ERC20InvalidApprover(address approver);\r
\r
/**\r
* @dev Indicates a failure with the `spender` to be approved. Used in approvals.\r
* @param spender Address that may be allowed to operate on tokens without being their owner.\r
*/\r
error ERC20InvalidSpender(address spender);\r
}\r
\r
/**\r
* @dev Standard ERC721 Errors\r
* Interface of the https://eips.ethereum.org/EIPS/eip-6093[ERC-6093] custom errors for ERC721 tokens.\r
*/\r
interface IERC721Errors {\r
/**\r
* @dev Indicates that an address can't be an owner. For example, `address(0)` is a forbidden owner in EIP-20.\r
* Used in balance queries.\r
* @param owner Address of the current owner of a token.\r
*/\r
error ERC721InvalidOwner(address owner);\r
\r
/**\r
* @dev Indicates a `tokenId` whose `owner` is the zero address.\r
* @param tokenId Identifier number of a token.\r
*/\r
error ERC721NonexistentToken(uint256 tokenId);\r
\r
/**\r
* @dev Indicates an error related to the ownership over a particular token. Used in transfers.\r
* @param sender Address whose tokens are being transferred.\r
* @param tokenId Identifier number of a token.\r
* @param owner Address of the current owner of a token.\r
*/\r
error ERC721IncorrectOwner(address sender, uint256 tokenId, address owner);\r
\r
/**\r
* @dev Indicates a failure with the token `sender`. Used in transfers.\r
* @param sender Address whose tokens are being transferred.\r
*/\r
error ERC721InvalidSender(address sender);\r
\r
/**\r
* @dev Indicates a failure with the token `receiver`. Used in transfers.\r
* @param receiver Address to which tokens are being transferred.\r
*/\r
error ERC721InvalidReceiver(address receiver);\r
\r
/**\r
* @dev Indicates a failure with the `operator`’s approval. Used in transfers.\r
* @param operator Address that may be allowed to operate on tokens without being their owner.\r
* @param tokenId Identifier number of a token.\r
*/\r
error ERC721InsufficientApproval(address operator, uint256 tokenId);\r
\r
/**\r
* @dev Indicates a failure with the `approver` of a token to be approved. Used in approvals.\r
* @param approver Address initiating an approval operation.\r
*/\r
error ERC721InvalidApprover(address approver);\r
\r
/**\r
* @dev Indicates a failure with the `operator` to be approved. Used in approvals.\r
* @param operator Address that may be allowed to operate on tokens without being their owner.\r
*/\r
error ERC721InvalidOperator(address operator);\r
}\r
\r
/**\r
* @dev Standard ERC1155 Errors\r
* Interface of the https://eips.ethereum.org/EIPS/eip-6093[ERC-6093] custom errors for ERC1155 tokens.\r
*/\r
interface IERC1155Errors {\r
/**\r
* @dev Indicates an error related to the current `balance` of a `sender`. Used in transfers.\r
* @param sender Address whose tokens are being transferred.\r
* @param balance Current balance for the interacting account.\r
* @param needed Minimum amount required to perform a transfer.\r
* @param tokenId Identifier number of a token.\r
*/\r
error ERC1155InsufficientBalance(address sender, uint256 balance, uint256 needed, uint256 tokenId);\r
\r
/**\r
* @dev Indicates a failure with the token `sender`. Used in transfers.\r
* @param sender Address whose tokens are being transferred.\r
*/\r
error ERC1155InvalidSender(address sender);\r
\r
/**\r
* @dev Indicates a failure with the token `receiver`. Used in transfers.\r
* @param receiver Address to which tokens are being transferred.\r
*/\r
error ERC1155InvalidReceiver(address receiver);\r
\r
/**\r
* @dev Indicates a failure with the `operator`’s approval. Used in transfers.\r
* @param operator Address that may be allowed to operate on tokens without being their owner.\r
* @param owner Address of the current owner of a token.\r
*/\r
error ERC1155MissingApprovalForAll(address operator, address owner);\r
\r
/**\r
* @dev Indicates a failure with the `approver` of a token to be approved. Used in approvals.\r
* @param approver Address initiating an approval operation.\r
*/\r
error ERC1155InvalidApprover(address approver);\r
\r
/**\r
* @dev Indicates a failure with the `operator` to be approved. Used in approvals.\r
* @param operator Address that may be allowed to operate on tokens without being their owner.\r
*/\r
error ERC1155InvalidOperator(address operator);\r
\r
/**\r
* @dev Indicates an array length mismatch between ids and values in a safeBatchTransferFrom operation.\r
* Used in batch transfers.\r
* @param idsLength Length of the array of token identifiers\r
* @param valuesLength Length of the array of token amounts\r
*/\r
error ERC1155InvalidArrayLength(uint256 idsLength, uint256 valuesLength);\r
}"
},
"artifacts/XTR/IERC20Metadata.sol": {
"content": "// SPDX-License-Identifier: MIT\r
// OpenZeppelin Contracts (last updated v5.0.0) (token/ERC20/extensions/IERC20Metadata.sol)\r
\r
pragma solidity ^0.8.20;\r
\r
import {IERC20} from "./IERC20.sol";\r
\r
/**\r
* @dev Interface for the optional metadata functions from the ERC20 standard.\r
*/\r
interface IERC20Metadata is IERC20 {\r
/**\r
* @dev Returns the name of the token.\r
*/\r
function name() external view returns (string memory);\r
\r
/**\r
* @dev Returns the symbol of the token.\r
*/\r
function symbol() external view returns (string memory);\r
\r
/**\r
* @dev Returns the decimals places of the token.\r
*/\r
function decimals() external view returns (uint8);\r
}"
}
},
"settings": {
"optimizer": {
"enabled": true,
"runs": 200
},
"outputSelection": {
"*": {
"*": [
"evm.bytecode",
"evm.deployedBytecode",
"devdoc",
"userdoc",
"metadata",
"abi"
]
}
},
"remappings": []
}
}}
Submitted on: 2025-10-28 19:56:12
Comments
Log in to comment.
No comments yet.