Address Contract Partially Verified
Address
0xD153539F893d549B4Bb6D746F609f6e46EEB8dE8
Balance
0 ETH
Nonce
1
Code Size
7705 bytes
Creator
0xCf87FDfE...5354 at tx 0x7558b3e8...7aa87f
Indexed Transactions
0
Contract Bytecode
7705 bytes
0x60806040526004361061021e5760003560e01c806376be96f311610123578063a9059cbb116100ab578063e2f456051161006f578063e2f4560514610661578063ef586f7114610677578063f2fde38b1461068c578063f5648a4f146106ac578063f66895a3146106c157600080fd5b8063a9059cbb146105c2578063afa4f3b2146105e2578063b886311514610602578063cb96372814610621578063dd62ed3e1461064157600080fd5b80638da5cb5b116100f25780638da5cb5b1461051b57806395d89b4114610539578063a3ca847d1461054e578063a457c2d71461056e578063a8b089821461058e57600080fd5b806376be96f3146104b95780637a845ece146104cf578063864701a5146104ef5780638a8c523c1461050657600080fd5b806339509351116101a6578063599ca39711610175578063599ca3971461040457806370a082311461041a578063715018a61461045057806372ac248614610465578063735de9f71461048557600080fd5b806339509351146103935780634a74bb02146103b35780634ada218b146103cd5780635331803c146103ed57600080fd5b806318160ddd116101ed57806318160ddd146102c75780631950c218146102e657806323b872dd1461031f57806324c0f8171461033f578063313ce5671461037757600080fd5b806306fdde031461022a5780630940bbc714610255578063095ea7b3146102775780630c424284146102a757600080fd5b3661022557005b600080fd5b34801561023657600080fd5b5061023f6106d8565b60405161024c9190611adf565b60405180910390f35b34801561026157600080fd5b50610275610270366004611b2d565b61076a565b005b34801561028357600080fd5b50610297610292366004611b5b565b610807565b604051901515815260200161024c565b3480156102b357600080fd5b506102756102c2366004611b95565b610821565b3480156102d357600080fd5b506002545b60405190815260200161024c565b3480156102f257600080fd5b50610297610301366004611bce565b6001600160a01b031660009081526009602052604090205460ff1690565b34801561032b57600080fd5b5061029761033a366004611beb565b61087d565b34801561034b57600080fd5b50600e5461035f906001600160a01b031681565b6040516001600160a01b03909116815260200161024c565b34801561038357600080fd5b506040516012815260200161024c565b34801561039f57600080fd5b506102976103ae366004611b5b565b6108a3565b3480156103bf57600080fd5b50600c546102979060ff1681565b3480156103d957600080fd5b50600c546102979062010000900460ff1681565b3480156103f957600080fd5b506008546102d89081565b34801561041057600080fd5b506102d8600a5481565b34801561042657600080fd5b506102d8610435366004611bce565b6001600160a01b031660009081526020819052604090205490565b34801561045c57600080fd5b506102756108c5565b34801561047157600080fd5b50610275610480366004611bce565b6108d9565b34801561049157600080fd5b5061035f7f0000000000000000000000007a250d5630b4cf539739df2c5dacb4c659f2488d81565b3480156104c557600080fd5b506102d8600d5481565b3480156104db57600080fd5b506102756104ea366004611b2d565b610990565b3480156104fb57600080fd5b506006546102d89081565b34801561051257600080fd5b50610275610a5e565b34801561052757600080fd5b506005546001600160a01b031661035f565b34801561054557600080fd5b5061023f610ad6565b34801561055a57600080fd5b50610275610569366004611b2d565b610ae5565b34801561057a57600080fd5b50610297610589366004611b5b565b610b7d565b34801561059a57600080fd5b5061035f7f000000000000000000000000303f79946694ef949c8108db4dfc289c7b91dcee81565b3480156105ce57600080fd5b506102976105dd366004611b5b565b610c03565b3480156105ee57600080fd5b506102756105fd366004611b2d565b610c11565b34801561060e57600080fd5b50600c5461029790610100900460ff1681565b34801561062d57600080fd5b5061027561063c366004611bce565b610d06565b34801561064d57600080fd5b506102d861065c366004611c2c565b610e9d565b34801561066d57600080fd5b506102d8600b5481565b34801561068357600080fd5b50610275610ec8565b34801561069857600080fd5b506102756106a7366004611bce565b610ef7565b3480156106b857600080fd5b50610275610f70565b3480156106cd57600080fd5b506007546102d89081565b6060600380546106e790611c5a565b80601f016020809104026020016040519081016040528092919081815260200182805461071390611c5a565b80156107605780601f1061073557610100808354040283529160200191610760565b820191906000526020600020905b81548152906001019060200180831161074357829003601f168201915b5050505050905090565b610772611010565b6007819055600a8111156107d95760405162461bcd60e51b815260206004820152602360248201527f43616e206e6f742073657420627579206665657320686967686572207468616e60448201526220352560e81b60648201526084015b60405180910390fd5b60405181907f16df2c25b3392f376a685a3826b941b25140108d95899d6b1bd983feafbc1c5590600090a250565b60003361081581858561106a565b60019150505b92915050565b610829611010565b6001600160a01b038216600081815260096020526040808220805460ff191685151590811790915590519092917f5a25e09a5dba33161281055e015f1279b6b10204d8f90dd56a8ce2b82322d43d91a35050565b60003361088b85828561118e565b610896858585611208565b60019150505b9392505050565b6000336108158185856108b68383610e9d565b6108c09190611caa565b61106a565b6108cd611010565b6108d76000611538565b565b6108e1611010565b6001600160a01b0381166109465760405162461bcd60e51b815260206004820152602660248201527f63616e206e6f742073657420446576656c6f706d656e7420746f2064656164206044820152651dd85b1b195d60d21b60648201526084016107d0565b600e80546001600160a01b0319166001600160a01b0383169081179091556040517f2e184dc34ab031d763441c588bd08760997797e8550c76fd439a20571233cc2090600090a250565b610998611010565b600181116109f35760405162461bcd60e51b815260206004820152602260248201527f50657263656e74616765206d7573742062652067726561746572207468616e20604482015261312560f01b60648201526084016107d0565b6064811115610a595760405162461bcd60e51b815260206004820152602c60248201527f50657263656e74616765206d757374206265206c657373207468616e206f722060448201526b0657175616c20746f203130360a41b60648201526084016107d0565b600a55565b610a66611010565b600c5462010000900460ff1615610abf5760405162461bcd60e51b815260206004820152601a60248201527f54726164696e6720697320616c726561647920656e61626c656400000000000060448201526064016107d0565b600c805462ff000019166201000017905543600d55565b6060600480546106e790611c5a565b610aed611010565b6006819055600a811115610b4f5760405162461bcd60e51b8152602060048201526024808201527f43616e206e6f742073657420627579206665657320686967686572207468616e6044820152632031302560e01b60648201526084016107d0565b60405181907f491005465ab6f82fd10f4b13a1b1e5ca452bc4856b019f63775e33a6b1ad2feb90600090a250565b60003381610b8b8286610e9d565b905083811015610beb5760405162461bcd60e51b815260206004820152602560248201527f45524332303a2064656372656173656420616c6c6f77616e63652062656c6f77604482015264207a65726f60d81b60648201526084016107d0565b610bf8828686840361106a565b506001949350505050565b600033610815818585611208565b610c19611010565b600081118015610c4a57506103e8610c3c69d3c21bcecceda10000006005611cbd565b610c469190611cd4565b8111155b610cd35760405162461bcd60e51b815260206004820152604e60248201527f4d696e696d756d207377617020616d6f756e74206d757374206265206772656160448201527f746572207468616e203020616e64206c657373207468616e20302e3525206f6660648201526d20746f74616c20737570706c792160901b608482015260a4016107d0565b600b81905560405181907f18ff2fc8464635e4f668567019152095047e34d7a2ab4b97661ba4dc7fd0647690600090a250565b610d0e611010565b6040516370a0823160e01b81523060048201526000906001600160a01b0383169063a9059cbb90339083906370a0823190602401602060405180830381865afa158015610d5f573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d839190611cf6565b6040516001600160e01b031960e085901b1681526001600160a01b03909216600483015260248201526044016020604051808303816000875af1158015610dce573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610df29190611d0f565b905080610e415760405162461bcd60e51b815260206004820152601b60248201527f7472616e7366657272696e6720746f6b656e73206661696c656421000000000060448201526064016107d0565b306001600160a01b03831603610e995760405162461bcd60e51b815260206004820181905260248201527f4f776e65722063616e6e6f7420636c61696d206e617469766520746f6b656e7360448201526064016107d0565b5050565b6001600160a01b03918216600090815260016020908152604080832093909416825291909152205490565b610ed0611010565b600c5460ff16610ee1576001610ee4565b60005b600c805460ff1916911515919091179055565b610eff611010565b6001600160a01b038116610f645760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084016107d0565b610f6d81611538565b50565b610f78611010565b604051600090339047908381818185875af1925050503d8060008114610fba576040519150601f19603f3d011682016040523d82523d6000602084013e610fbf565b606091505b5050905080610f6d5760405162461bcd60e51b815260206004820152601760248201527f7472616e7366657272696e6720455448206661696c656400000000000000000060448201526064016107d0565b6005546001600160a01b031633146108d75760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064016107d0565b6001600160a01b0383166110cc5760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b60648201526084016107d0565b6001600160a01b03821661112d5760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b60648201526084016107d0565b6001600160a01b0383811660008181526001602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b600061119a8484610e9d565b9050600019811461120257818110156111f55760405162461bcd60e51b815260206004820152601d60248201527f45524332303a20696e73756666696369656e7420616c6c6f77616e636500000060448201526064016107d0565b611202848484840361106a565b50505050565b6001600160a01b03831661125e5760405162461bcd60e51b815260206004820152601a60248201527f7472616e736665722066726f6d2061646472657373207a65726f00000000000060448201526064016107d0565b6001600160a01b0382166112b45760405162461bcd60e51b815260206004820152601860248201527f7472616e7366657220746f2061646472657373207a65726f000000000000000060448201526064016107d0565b600081116113165760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b60648201526084016107d0565b600061132384848461158a565b600b5430600090815260208181526040808320546001600160a01b038a16845260099092529091205492935010159060ff1615801561137b57506001600160a01b03841660009081526009602052604090205460ff16155b1561152657600c5462010000900460ff166113cd5760405162461bcd60e51b815260206004820152601260248201527154726164696e67206e6f742061637469766560701b60448201526064016107d0565b7f000000000000000000000000303f79946694ef949c8108db4dfc289c7b91dcee6001600160a01b0316846001600160a01b03161415801561145a57506064600a5469d3c21bcecceda10000006114249190611cbd565b61142e9190611cd4565b8261144e866001600160a01b031660009081526020819052604090205490565b6114589190611caa565b115b156114b95760405162461bcd60e51b815260206004820152602960248201527f57616c6c65742062616c616e63652065786365656473206d6178696d756d2070604482015268657263656e7461676560b81b60648201526084016107d0565b836001600160a01b03167f000000000000000000000000303f79946694ef949c8108db4dfc289c7b91dcee6001600160a01b03161480156114fc5750600c5460ff165b80156115055750805b80156115195750600c54610100900460ff16155b1561152657611526611691565b61153185858461177b565b5050505050565b600580546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b6001600160a01b03831660009081526009602052604081205460ff16806115c957506001600160a01b03831660009081526009602052604090205460ff165b156115d557508061089c565b6008546001600160a01b037f000000000000000000000000303f79946694ef949c8108db4dfc289c7b91dcee8116908516036116145750600754611652565b7f000000000000000000000000303f79946694ef949c8108db4dfc289c7b91dcee6001600160a01b0316856001600160a01b03160361165257506006545b6000811561167d5760646116668386611cbd565b6116709190611cd4565b905061167d86308361177b565b6116878185611d2c565b9695505050505050565b600c805461ff001916610100179055306000908152602081905260408120549050806000036116bd5750565b306000908152602081905260409020546116d69061191f565b600e546040516000916001600160a01b03169047908381818185875af1925050503d8060008114611723576040519150601f19603f3d011682016040523d82523d6000602084013e611728565b606091505b505090508061176c5760405162461bcd60e51b815260206004820152601060248201526f2a3930b739b332b9103330b4b632b21760811b60448201526064016107d0565b5050600c805461ff0019169055565b6001600160a01b0383166117df5760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b60648201526084016107d0565b6001600160a01b0382166118415760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b60648201526084016107d0565b6001600160a01b038316600090815260208190526040902054818110156118b95760405162461bcd60e51b815260206004820152602660248201527f45524332303a207472616e7366657220616d6f756e7420657863656564732062604482015265616c616e636560d01b60648201526084016107d0565b6001600160a01b03848116600081815260208181526040808320878703905593871680835291849020805487019055925185815290927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef910160405180910390a3611202565b604080516002808252606082018352600092602083019080368337019050509050308160008151811061195457611954611d3f565b60200260200101906001600160a01b031690816001600160a01b0316815250507f0000000000000000000000007a250d5630b4cf539739df2c5dacb4c659f2488d6001600160a01b031663ad5c46486040518163ffffffff1660e01b8152600401602060405180830381865afa1580156119d2573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906119f69190611d55565b81600181518110611a0957611a09611d3f565b60200260200101906001600160a01b031690816001600160a01b031681525050611a54307f0000000000000000000000007a250d5630b4cf539739df2c5dacb4c659f2488d8461106a565b60405163791ac94760e01b81526001600160a01b037f0000000000000000000000007a250d5630b4cf539739df2c5dacb4c659f2488d169063791ac94790611aa9908590600090869030904290600401611d72565b600060405180830381600087803b158015611ac357600080fd5b505af1158015611ad7573d6000803e3d6000fd5b505050505050565b600060208083528351808285015260005b81811015611b0c57858101830151858201604001528201611af0565b506000604082860101526040601f19601f8301168501019250505092915050565b600060208284031215611b3f57600080fd5b5035919050565b6001600160a01b0381168114610f6d57600080fd5b60008060408385031215611b6e57600080fd5b8235611b7981611b46565b946020939093013593505050565b8015158114610f6d57600080fd5b60008060408385031215611ba857600080fd5b8235611bb381611b46565b91506020830135611bc381611b87565b809150509250929050565b600060208284031215611be057600080fd5b813561089c81611b46565b600080600060608486031215611c0057600080fd5b8335611c0b81611b46565b92506020840135611c1b81611b46565b929592945050506040919091013590565b60008060408385031215611c3f57600080fd5b8235611c4a81611b46565b91506020830135611bc381611b46565b600181811c90821680611c6e57607f821691505b602082108103611c8e57634e487b7160e01b600052602260045260246000fd5b50919050565b634e487b7160e01b600052601160045260246000fd5b8082018082111561081b5761081b611c94565b808202811582820484141761081b5761081b611c94565b600082611cf157634e487b7160e01b600052601260045260246000fd5b500490565b600060208284031215611d0857600080fd5b5051919050565b600060208284031215611d2157600080fd5b815161089c81611b87565b8181038181111561081b5761081b611c94565b634e487b7160e01b600052603260045260246000fd5b600060208284031215611d6757600080fd5b815161089c81611b46565b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b81811015611dc25784516001600160a01b031683529383019391830191600101611d9d565b50506001600160a01b0396909616606085015250505060800152939250505056fea2646970667358221220a04fabedf552a64856515972d1872e1d5f92089169155e9d9638d81edf55c39d64736f6c63430008130033
Verified Source Code Partial Match
Compiler: v0.8.19+commit.7dd6d404
EVM: paris
Optimization: Yes (200 runs)
PRO.sol 1104 lines
// File: @openzeppelin/contracts/utils/math/SafeMath.sol
// OpenZeppelin Contracts (last updated v4.6.0) (utils/math/SafeMath.sol)
pragma solidity ^0.8.0;
// CAUTION
// This version of SafeMath should only be used with Solidity 0.8 or later,
// because it relies on the compiler's built in overflow checks.
/**
* @dev Wrappers over Solidity's arithmetic operations.
*
* NOTE: `SafeMath` is generally not needed starting with Solidity 0.8, since the compiler
* now has built in overflow checking.
*/
library SafeMath {
/**
* @dev Returns the addition of two unsigned integers, with an overflow flag.
*
* _Available since v3.4._
*/
function tryAdd(uint256 a, uint256 b) internal pure returns (bool, uint256) {
unchecked {
uint256 c = a + b;
if (c < a) return (false, 0);
return (true, c);
}
}
/**
* @dev Returns the subtraction of two unsigned integers, with an overflow flag.
*
* _Available since v3.4._
*/
function trySub(uint256 a, uint256 b) internal pure returns (bool, uint256) {
unchecked {
if (b > a) return (false, 0);
return (true, a - b);
}
}
/**
* @dev Returns the multiplication of two unsigned integers, with an overflow flag.
*
* _Available since v3.4._
*/
function tryMul(uint256 a, uint256 b) internal pure returns (bool, uint256) {
unchecked {
// Gas optimization: this is cheaper than requiring 'a' not being zero, but the
// benefit is lost if 'b' is also tested.
// See: https://github.com/OpenZeppelin/openzeppelin-contracts/pull/522
if (a == 0) return (true, 0);
uint256 c = a * b;
if (c / a != b) return (false, 0);
return (true, c);
}
}
/**
* @dev Returns the division of two unsigned integers, with a division by zero flag.
*
* _Available since v3.4._
*/
function tryDiv(uint256 a, uint256 b) internal pure returns (bool, uint256) {
unchecked {
if (b == 0) return (false, 0);
return (true, a / b);
}
}
/**
* @dev Returns the remainder of dividing two unsigned integers, with a division by zero flag.
*
* _Available since v3.4._
*/
function tryMod(uint256 a, uint256 b) internal pure returns (bool, uint256) {
unchecked {
if (b == 0) return (false, 0);
return (true, a % b);
}
}
/**
* @dev Returns the addition of two unsigned integers, reverting on
* overflow.
*
* Counterpart to Solidity's `+` operator.
*
* Requirements:
*
* - Addition cannot overflow.
*/
function add(uint256 a, uint256 b) internal pure returns (uint256) {
return a + b;
}
/**
* @dev Returns the subtraction of two unsigned integers, reverting on
* overflow (when the result is negative).
*
* Counterpart to Solidity's `-` operator.
*
* Requirements:
*
* - Subtraction cannot overflow.
*/
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
return a - b;
}
/**
* @dev Returns the multiplication of two unsigned integers, reverting on
* overflow.
*
* Counterpart to Solidity's `*` operator.
*
* Requirements:
*
* - Multiplication cannot overflow.
*/
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
return a * b;
}
/**
* @dev Returns the integer division of two unsigned integers, reverting on
* division by zero. The result is rounded towards zero.
*
* Counterpart to Solidity's `/` operator.
*
* Requirements:
*
* - The divisor cannot be zero.
*/
function div(uint256 a, uint256 b) internal pure returns (uint256) {
return a / b;
}
/**
* @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),
* reverting when dividing by zero.
*
* Counterpart to Solidity's `%` operator. This function uses a `revert`
* opcode (which leaves remaining gas untouched) while Solidity uses an
* invalid opcode to revert (consuming all remaining gas).
*
* Requirements:
*
* - The divisor cannot be zero.
*/
function mod(uint256 a, uint256 b) internal pure returns (uint256) {
return a % b;
}
/**
* @dev Returns the subtraction of two unsigned integers, reverting with custom message on
* overflow (when the result is negative).
*
* CAUTION: This function is deprecated because it requires allocating memory for the error
* message unnecessarily. For custom revert reasons use {trySub}.
*
* Counterpart to Solidity's `-` operator.
*
* Requirements:
*
* - Subtraction cannot overflow.
*/
function sub(
uint256 a,
uint256 b,
string memory errorMessage
) internal pure returns (uint256) {
unchecked {
require(b <= a, errorMessage);
return a - b;
}
}
/**
* @dev Returns the integer division of two unsigned integers, reverting with custom message on
* division by zero. The result is rounded towards zero.
*
* Counterpart to Solidity's `/` operator. Note: this function uses a
* `revert` opcode (which leaves remaining gas untouched) while Solidity
* uses an invalid opcode to revert (consuming all remaining gas).
*
* Requirements:
*
* - The divisor cannot be zero.
*/
function div(
uint256 a,
uint256 b,
string memory errorMessage
) internal pure returns (uint256) {
unchecked {
require(b > 0, errorMessage);
return a / b;
}
}
/**
* @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),
* reverting with custom message when dividing by zero.
*
* CAUTION: This function is deprecated because it requires allocating memory for the error
* message unnecessarily. For custom revert reasons use {tryMod}.
*
* Counterpart to Solidity's `%` operator. This function uses a `revert`
* opcode (which leaves remaining gas untouched) while Solidity uses an
* invalid opcode to revert (consuming all remaining gas).
*
* Requirements:
*
* - The divisor cannot be zero.
*/
function mod(
uint256 a,
uint256 b,
string memory errorMessage
) internal pure returns (uint256) {
unchecked {
require(b > 0, errorMessage);
return a % b;
}
}
}
// File: @openzeppelin/contracts/utils/Context.sol
// OpenZeppelin Contracts v4.4.1 (utils/Context.sol)
pragma solidity ^0.8.0;
/**
* @dev Provides information about the current execution context, including the
* sender of the transaction and its data. While these are generally available
* via msg.sender and msg.data, they should not be accessed in such a direct
* manner, since when dealing with meta-transactions the account sending and
* paying for execution may not be the actual sender (as far as an application
* is concerned).
*
* This contract is only required for intermediate, library-like contracts.
*/
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
function _msgData() internal view virtual returns (bytes calldata) {
return msg.data;
}
}
// File: @openzeppelin/contracts/access/Ownable.sol
// OpenZeppelin Contracts (last updated v4.7.0) (access/Ownable.sol)
pragma solidity ^0.8.0;
/**
* @dev Contract module which provides a basic access control mechanism, where
* there is an account (an owner) that can be granted exclusive access to
* specific functions.
*
* By default, the owner account will be the one that deploys the contract. This
* can later be changed with {transferOwnership}.
*
* This module is used through inheritance. It will make available the modifier
* `onlyOwner`, which can be applied to your functions to restrict their use to
* the owner.
*/
abstract contract Ownable is Context {
address private _owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
/**
* @dev Initializes the contract setting the deployer as the initial owner.
*/
constructor() {
_transferOwnership(_msgSender());
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
_checkOwner();
_;
}
/**
* @dev Returns the address of the current owner.
*/
function owner() public view virtual returns (address) {
return _owner;
}
/**
* @dev Throws if the sender is not the owner.
*/
function _checkOwner() internal view virtual {
require(owner() == _msgSender(), "Ownable: caller is not the owner");
}
/**
* @dev Leaves the contract without owner. It will not be possible to call
* `onlyOwner` functions anymore. Can only be called by the current owner.
*
* NOTE: Renouncing ownership will leave the contract without an owner,
* thereby removing any functionality that is only available to the owner.
*/
function renounceOwnership() public virtual onlyOwner {
_transferOwnership(address(0));
}
/**
* @dev Transfers ownership of the contract to a new account (`newOwner`).
* Can only be called by the current owner.
*/
function transferOwnership(address newOwner) public virtual onlyOwner {
require(newOwner != address(0), "Ownable: new owner is the zero address");
_transferOwnership(newOwner);
}
/**
* @dev Transfers ownership of the contract to a new account (`newOwner`).
* Internal function without access restriction.
*/
function _transferOwnership(address newOwner) internal virtual {
address oldOwner = _owner;
_owner = newOwner;
emit OwnershipTransferred(oldOwner, newOwner);
}
}
// File: @openzeppelin/contracts/token/ERC20/IERC20.sol
// OpenZeppelin Contracts (last updated v4.6.0) (token/ERC20/IERC20.sol)
pragma solidity ^0.8.0;
/**
* @dev Interface of the ERC20 standard as defined in the EIP.
*/
interface IERC20 {
/**
* @dev Emitted when `value` tokens are moved from one account (`from`) to
* another (`to`).
*
* Note that `value` may be zero.
*/
event Transfer(address indexed from, address indexed to, uint256 value);
/**
* @dev Emitted when the allowance of a `spender` for an `owner` is set by
* a call to {approve}. `value` is the new allowance.
*/
event Approval(address indexed owner, address indexed spender, uint256 value);
/**
* @dev Returns the amount of tokens in existence.
*/
function totalSupply() external view returns (uint256);
/**
* @dev Returns the amount of tokens owned by `account`.
*/
function balanceOf(address account) external view returns (uint256);
/**
* @dev Moves `amount` tokens from the caller's account to `to`.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* Emits a {Transfer} event.
*/
function transfer(address to, uint256 amount) external returns (bool);
/**
* @dev Returns the remaining number of tokens that `spender` will be
* allowed to spend on behalf of `owner` through {transferFrom}. This is
* zero by default.
*
* This value changes when {approve} or {transferFrom} are called.
*/
function allowance(address owner, address spender) external view returns (uint256);
/**
* @dev Sets `amount` as the allowance of `spender` over the caller's tokens.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* IMPORTANT: Beware that changing an allowance with this method brings the risk
* that someone may use both the old and the new allowance by unfortunate
* transaction ordering. One possible solution to mitigate this race
* condition is to first reduce the spender's allowance to 0 and set the
* desired value afterwards:
* https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
*
* Emits an {Approval} event.
*/
function approve(address spender, uint256 amount) external returns (bool);
/**
* @dev Moves `amount` tokens from `from` to `to` using the
* allowance mechanism. `amount` is then deducted from the caller's
* allowance.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* Emits a {Transfer} event.
*/
function transferFrom(
address from,
address to,
uint256 amount
) external returns (bool);
}
// File: @openzeppelin/contracts/token/ERC20/extensions/IERC20Metadata.sol
// OpenZeppelin Contracts v4.4.1 (token/ERC20/extensions/IERC20Metadata.sol)
pragma solidity ^0.8.0;
/**
* @dev Interface for the optional metadata functions from the ERC20 standard.
*
* _Available since v4.1._
*/
interface IERC20Metadata is IERC20 {
/**
* @dev Returns the name of the token.
*/
function name() external view returns (string memory);
/**
* @dev Returns the symbol of the token.
*/
function symbol() external view returns (string memory);
/**
* @dev Returns the decimals places of the token.
*/
function decimals() external view returns (uint8);
}
// File: @openzeppelin/contracts/token/ERC20/ERC20.sol
// OpenZeppelin Contracts (last updated v4.8.0) (token/ERC20/ERC20.sol)
pragma solidity ^0.8.0;
/**
* @dev Implementation of the {IERC20} interface.
*
* This implementation is agnostic to the way tokens are created. This means
* that a supply mechanism has to be added in a derived contract using {_mint}.
* For a generic mechanism see {ERC20PresetMinterPauser}.
*
* TIP: For a detailed writeup see our guide
* https://forum.openzeppelin.com/t/how-to-implement-erc20-supply-mechanisms/226[How
* to implement supply mechanisms].
*
* We have followed general OpenZeppelin Contracts guidelines: functions revert
* instead returning `false` on failure. This behavior is nonetheless
* conventional and does not conflict with the expectations of ERC20
* applications.
*
* Additionally, an {Approval} event is emitted on calls to {transferFrom}.
* This allows applications to reconstruct the allowance for all accounts just
* by listening to said events. Other implementations of the EIP may not emit
* these events, as it isn't required by the specification.
*
* Finally, the non-standard {decreaseAllowance} and {increaseAllowance}
* functions have been added to mitigate the well-known issues around setting
* allowances. See {IERC20-approve}.
*/
contract ERC20 is Context, IERC20, IERC20Metadata {
mapping(address => uint256) private _balances;
mapping(address => mapping(address => uint256)) private _allowances;
uint256 private _totalSupply;
string private _name;
string private _symbol;
/**
* @dev Sets the values for {name} and {symbol}.
*
* The default value of {decimals} is 18. To select a different value for
* {decimals} you should overload it.
*
* All two of these values are immutable: they can only be set once during
* construction.
*/
constructor(string memory name_, string memory symbol_) {
_name = name_;
_symbol = symbol_;
}
/**
* @dev Returns the name of the token.
*/
function name() public view virtual override returns (string memory) {
return _name;
}
/**
* @dev Returns the symbol of the token, usually a shorter version of the
* name.
*/
function symbol() public view virtual override returns (string memory) {
return _symbol;
}
/**
* @dev Returns the number of decimals used to get its user representation.
* For example, if `decimals` equals `2`, a balance of `505` tokens should
* be displayed to a user as `5.05` (`505 / 10 ** 2`).
*
* Tokens usually opt for a value of 18, imitating the relationship between
* Ether and Wei. This is the value {ERC20} uses, unless this function is
* overridden;
*
* NOTE: This information is only used for _display_ purposes: it in
* no way affects any of the arithmetic of the contract, including
* {IERC20-balanceOf} and {IERC20-transfer}.
*/
function decimals() public view virtual override returns (uint8) {
return 18;
}
/**
* @dev See {IERC20-totalSupply}.
*/
function totalSupply() public view virtual override returns (uint256) {
return _totalSupply;
}
/**
* @dev See {IERC20-balanceOf}.
*/
function balanceOf(address account) public view virtual override returns (uint256) {
return _balances[account];
}
/**
* @dev See {IERC20-transfer}.
*
* Requirements:
*
* - `to` cannot be the zero address.
* - the caller must have a balance of at least `amount`.
*/
function transfer(address to, uint256 amount) public virtual override returns (bool) {
address owner = _msgSender();
_transfer(owner, to, amount);
return true;
}
/**
* @dev See {IERC20-allowance}.
*/
function allowance(address owner, address spender) public view virtual override returns (uint256) {
return _allowances[owner][spender];
}
/**
* @dev See {IERC20-approve}.
*
* NOTE: If `amount` is the maximum `uint256`, the allowance is not updated on
* `transferFrom`. This is semantically equivalent to an infinite approval.
*
* Requirements:
*
* - `spender` cannot be the zero address.
*/
function approve(address spender, uint256 amount) public virtual override returns (bool) {
address owner = _msgSender();
_approve(owner, spender, amount);
return true;
}
/**
* @dev See {IERC20-transferFrom}.
*
* Emits an {Approval} event indicating the updated allowance. This is not
* required by the EIP. See the note at the beginning of {ERC20}.
*
* NOTE: Does not update the allowance if the current allowance
* is the maximum `uint256`.
*
* Requirements:
*
* - `from` and `to` cannot be the zero address.
* - `from` must have a balance of at least `amount`.
* - the caller must have allowance for ``from``'s tokens of at least
* `amount`.
*/
function transferFrom(
address from,
address to,
uint256 amount
) public virtual override returns (bool) {
address spender = _msgSender();
_spendAllowance(from, spender, amount);
_transfer(from, to, amount);
return true;
}
/**
* @dev Atomically increases the allowance granted to `spender` by the caller.
*
* This is an alternative to {approve} that can be used as a mitigation for
* problems described in {IERC20-approve}.
*
* Emits an {Approval} event indicating the updated allowance.
*
* Requirements:
*
* - `spender` cannot be the zero address.
*/
function increaseAllowance(address spender, uint256 addedValue) public virtual returns (bool) {
address owner = _msgSender();
_approve(owner, spender, allowance(owner, spender) + addedValue);
return true;
}
/**
* @dev Atomically decreases the allowance granted to `spender` by the caller.
*
* This is an alternative to {approve} that can be used as a mitigation for
* problems described in {IERC20-approve}.
*
* Emits an {Approval} event indicating the updated allowance.
*
* Requirements:
*
* - `spender` cannot be the zero address.
* - `spender` must have allowance for the caller of at least
* `subtractedValue`.
*/
function decreaseAllowance(address spender, uint256 subtractedValue) public virtual returns (bool) {
address owner = _msgSender();
uint256 currentAllowance = allowance(owner, spender);
require(currentAllowance >= subtractedValue, "ERC20: decreased allowance below zero");
unchecked {
_approve(owner, spender, currentAllowance - subtractedValue);
}
return true;
}
/**
* @dev Moves `amount` of tokens from `from` to `to`.
*
* This internal function is equivalent to {transfer}, and can be used to
* e.g. implement automatic token fees, slashing mechanisms, etc.
*
* Emits a {Transfer} event.
*
* Requirements:
*
* - `from` cannot be the zero address.
* - `to` cannot be the zero address.
* - `from` must have a balance of at least `amount`.
*/
function _transfer(
address from,
address to,
uint256 amount
) internal virtual {
require(from != address(0), "ERC20: transfer from the zero address");
require(to != address(0), "ERC20: transfer to the zero address");
_beforeTokenTransfer(from, to, amount);
uint256 fromBalance = _balances[from];
require(fromBalance >= amount, "ERC20: transfer amount exceeds balance");
unchecked {
_balances[from] = fromBalance - amount;
// Overflow not possible: the sum of all balances is capped by totalSupply, and the sum is preserved by
// decrementing then incrementing.
_balances[to] += amount;
}
emit Transfer(from, to, amount);
_afterTokenTransfer(from, to, amount);
}
/** @dev Creates `amount` tokens and assigns them to `account`, increasing
* the total supply.
*
* Emits a {Transfer} event with `from` set to the zero address.
*
* Requirements:
*
* - `account` cannot be the zero address.
*/
function _mint(address account, uint256 amount) internal virtual {
require(account != address(0), "ERC20: mint to the zero address");
_beforeTokenTransfer(address(0), account, amount);
_totalSupply += amount;
unchecked {
// Overflow not possible: balance + amount is at most totalSupply + amount, which is checked above.
_balances[account] += amount;
}
emit Transfer(address(0), account, amount);
_afterTokenTransfer(address(0), account, amount);
}
/**
* @dev Destroys `amount` tokens from `account`, reducing the
* total supply.
*
* Emits a {Transfer} event with `to` set to the zero address.
*
* Requirements:
*
* - `account` cannot be the zero address.
* - `account` must have at least `amount` tokens.
*/
function _burn(address account, uint256 amount) internal virtual {
require(account != address(0), "ERC20: burn from the zero address");
_beforeTokenTransfer(account, address(0), amount);
uint256 accountBalance = _balances[account];
require(accountBalance >= amount, "ERC20: burn amount exceeds balance");
unchecked {
_balances[account] = accountBalance - amount;
// Overflow not possible: amount <= accountBalance <= totalSupply.
_totalSupply -= amount;
}
emit Transfer(account, address(0), amount);
_afterTokenTransfer(account, address(0), amount);
}
/**
* @dev Sets `amount` as the allowance of `spender` over the `owner` s tokens.
*
* This internal function is equivalent to `approve`, and can be used to
* e.g. set automatic allowances for certain subsystems, etc.
*
* Emits an {Approval} event.
*
* Requirements:
*
* - `owner` cannot be the zero address.
* - `spender` cannot be the zero address.
*/
function _approve(
address owner,
address spender,
uint256 amount
) internal virtual {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
/**
* @dev Updates `owner` s allowance for `spender` based on spent `amount`.
*
* Does not update the allowance amount in case of infinite allowance.
* Revert if not enough allowance is available.
*
* Might emit an {Approval} event.
*/
function _spendAllowance(
address owner,
address spender,
uint256 amount
) internal virtual {
uint256 currentAllowance = allowance(owner, spender);
if (currentAllowance != type(uint256).max) {
require(currentAllowance >= amount, "ERC20: insufficient allowance");
unchecked {
_approve(owner, spender, currentAllowance - amount);
}
}
}
/**
* @dev Hook that is called before any transfer of tokens. This includes
* minting and burning.
*
* Calling conditions:
*
* - when `from` and `to` are both non-zero, `amount` of ``from``'s tokens
* will be transferred to `to`.
* - when `from` is zero, `amount` tokens will be minted for `to`.
* - when `to` is zero, `amount` of ``from``'s tokens will be burned.
* - `from` and `to` are never both zero.
*
* To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].
*/
function _beforeTokenTransfer(
address from,
address to,
uint256 amount
) internal virtual {}
/**
* @dev Hook that is called after any transfer of tokens. This includes
* minting and burning.
*
* Calling conditions:
*
* - when `from` and `to` are both non-zero, `amount` of ``from``'s tokens
* has been transferred to `to`.
* - when `from` is zero, `amount` tokens have been minted for `to`.
* - when `to` is zero, `amount` of ``from``'s tokens have been burned.
* - `from` and `to` are never both zero.
*
* To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].
*/
function _afterTokenTransfer(
address from,
address to,
uint256 amount
) internal virtual {}
}
// File: THEPRO.sol
//SPDX-License-Identifier: MIT
pragma solidity 0.8.19;
interface DexFactory {
function createPair(
address tokenA,
address tokenB
) external returns (address pair);
}
interface DexRouter {
function factory() external pure returns (address);
function WETH() external pure returns (address);
function addLiquidityETH(
address token,
uint256 amountTokenDesired,
uint256 amountTokenMin,
uint256 amountETHMin,
address to,
uint256 deadline
)
external
payable
returns (uint256 amountToken, uint256 amountETH, uint256 liquidity);
function swapExactTokensForETHSupportingFeeOnTransferTokens(
uint256 amountIn,
uint256 amountOutMin,
address[] calldata path,
address to,
uint256 deadline
) external;
}
contract PRO is ERC20, Ownable {
struct Tax {
uint256 marketingTax;
}
uint256 private constant _totalSupply = 1_000_000 * 1e18;
//Router
DexRouter public immutable uniswapRouter;
address public immutable pairAddress;
//Taxes
Tax public buyTaxes = Tax(5);
Tax public sellTaxes = Tax(5);
Tax public transferTaxes = Tax(0);
//Whitelisting from taxes/maxwallet/txlimit/etc
mapping(address => bool) private whitelisted;
uint256 public maxWalletPercentage = 2;
//Swapping
uint256 public swapTokensAtAmount = _totalSupply / 100000; //after 0.001% of total supply, swap them
bool public swapAndLiquifyEnabled = true;
bool public isSwapping = false;
bool public tradingEnabled = false;
uint256 public startTradingBlock;
//Wallets
address public DevelopmentWallet = 0x4D50442757F9f58bEFB2C43d4f694907a660a298 ;
//Events
event DevelopmentWalletChanged(address indexed _trWallet);
event BuyFeesUpdated(uint256 indexed _trFee);
event SellFeesUpdated(uint256 indexed _trFee);
event TransferFeesUpdated(uint256 indexed _trFee);
event SwapThresholdUpdated(uint256 indexed _newThreshold);
event InternalSwapStatusUpdated(bool indexed _status);
event Whitelist(address indexed _target, bool indexed _status);
constructor() ERC20("The Pro", "PRO") {
uniswapRouter = DexRouter(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D); // main
pairAddress = DexFactory(uniswapRouter.factory()).createPair(
address(this),
uniswapRouter.WETH()
);
whitelisted[msg.sender] = true;
whitelisted[address(uniswapRouter)] = true;
whitelisted[address(this)] = true;
_mint(msg.sender, _totalSupply);
}
function setDevelopmentWallet(address _newDevelopment) external onlyOwner {
require(
_newDevelopment != address(0),
"can not set Development to dead wallet"
);
DevelopmentWallet = _newDevelopment;
emit DevelopmentWalletChanged(_newDevelopment);
}
function enableTrading() external onlyOwner {
require(!tradingEnabled, "Trading is already enabled");
tradingEnabled = true;
startTradingBlock = block.number;
}
function setBuyTaxes(uint256 _marketingTax) external onlyOwner {
buyTaxes.marketingTax = _marketingTax;
require(_marketingTax <= 10, "Can not set buy fees higher than 10%");
emit BuyFeesUpdated(_marketingTax);
}
function setSellTaxes(uint256 _marketingTax) external onlyOwner {
sellTaxes.marketingTax = _marketingTax;
require(_marketingTax <= 10, "Can not set buy fees higher than 5%");
emit SellFeesUpdated(_marketingTax);
}
function setMaxWalletPercentage(uint256 _percentage) external onlyOwner {
require(_percentage > 1, "Percentage must be greater than 1%");
require(_percentage <= 100, "Percentage must be less than or equal to 100");
maxWalletPercentage = _percentage;
}
function setSwapTokensAtAmount(uint256 _newAmount) external onlyOwner {
require(
_newAmount > 0 && _newAmount <= (_totalSupply * 5) / 1000,
"Minimum swap amount must be greater than 0 and less than 0.5% of total supply!"
);
swapTokensAtAmount = _newAmount;
emit SwapThresholdUpdated(swapTokensAtAmount);
}
function toggleSwapping() external onlyOwner {
swapAndLiquifyEnabled = (swapAndLiquifyEnabled) ? false : true;
}
function setWhitelistStatus(
address _wallet,
bool _status
) external onlyOwner {
whitelisted[_wallet] = _status;
emit Whitelist(_wallet, _status);
}
function checkWhitelist(address _wallet) external view returns (bool) {
return whitelisted[_wallet];
}
// this function is reponsible for managing tax, if _from or _to is whitelisted, we simply return _amount and skip all the limitations
function _takeTax(
address _from,
address _to,
uint256 _amount
) internal returns (uint256) {
if (whitelisted[_from] || whitelisted[_to]) {
return _amount;
}
uint256 totalTax = transferTaxes.marketingTax;
if (_to == pairAddress) {
totalTax = sellTaxes.marketingTax;
} else if (_from == pairAddress) {
totalTax = buyTaxes.marketingTax;
}
uint256 tax = 0;
if (totalTax > 0) {
tax = (_amount * totalTax) / 100;
super._transfer(_from, address(this), tax);
}
return (_amount - tax);
}
function _transfer(
address _from,
address _to,
uint256 _amount
) internal virtual override {
require(_from != address(0), "transfer from address zero");
require(_to != address(0), "transfer to address zero");
require(_amount > 0, "Transfer amount must be greater than zero");
uint256 toTransfer = _takeTax(_from, _to, _amount);
bool canSwap = balanceOf(address(this)) >= swapTokensAtAmount;
if (
!whitelisted[_from] &&
!whitelisted[_to]
) {
require(tradingEnabled, "Trading not active");
// Check if the receiver's balance exceeds the maximum wallet percentage
if (_to != pairAddress && balanceOf(_to) + toTransfer > (_totalSupply * maxWalletPercentage) / 100) {
revert("Wallet balance exceeds maximum percentage");
}
if (
pairAddress == _to &&
swapAndLiquifyEnabled &&
canSwap &&
!isSwapping
) {
internalSwap();
}
}
super._transfer(_from, _to, toTransfer);
}
function internalSwap() internal {
isSwapping = true;
uint256 taxAmount = balanceOf(address(this));
if (taxAmount == 0) {
return;
}
swapToETH(balanceOf(address(this)));
(bool success, ) = DevelopmentWallet.call{value: address(this).balance}("");
require(success, "Transfer failed.");
isSwapping = false;
}
function swapToETH(uint256 _amount) internal {
address[] memory path = new address[](2);
path[0] = address(this);
path[1] = uniswapRouter.WETH();
_approve(address(this), address(uniswapRouter), _amount);
uniswapRouter.swapExactTokensForETHSupportingFeeOnTransferTokens(
_amount,
0,
path,
address(this),
block.timestamp
);
}
function withdrawStuckETH() external onlyOwner {
(bool success, ) = address(msg.sender).call{
value: address(this).balance
}("");
require(success, "transferring ETH failed");
}
function withdrawStuckTokens(address BEP20_token) external onlyOwner {
bool success = IERC20(BEP20_token).transfer(
msg.sender,
IERC20(BEP20_token).balanceOf(address(this))
);
require(success, "transferring tokens failed!");
require(BEP20_token != address(this), "Owner cannot claim native tokens");
}
receive() external payable {}
}
Read Contract
DevelopmentWallet 0x24c0f817 → address
allowance 0xdd62ed3e → uint256
balanceOf 0x70a08231 → uint256
buyTaxes 0x864701a5 → uint256
checkWhitelist 0x1950c218 → bool
decimals 0x313ce567 → uint8
isSwapping 0xb8863115 → bool
maxWalletPercentage 0x599ca397 → uint256
name 0x06fdde03 → string
owner 0x8da5cb5b → address
pairAddress 0xa8b08982 → address
sellTaxes 0xf66895a3 → uint256
startTradingBlock 0x76be96f3 → uint256
swapAndLiquifyEnabled 0x4a74bb02 → bool
swapTokensAtAmount 0xe2f45605 → uint256
symbol 0x95d89b41 → string
totalSupply 0x18160ddd → uint256
tradingEnabled 0x4ada218b → bool
transferTaxes 0x5331803c → uint256
uniswapRouter 0x735de9f7 → address
Write Contract 17 functions
These functions modify contract state and require a wallet transaction to execute.
approve 0x095ea7b3
address spender
uint256 amount
returns: bool
decreaseAllowance 0xa457c2d7
address spender
uint256 subtractedValue
returns: bool
enableTrading 0x8a8c523c
No parameters
increaseAllowance 0x39509351
address spender
uint256 addedValue
returns: bool
renounceOwnership 0x715018a6
No parameters
setBuyTaxes 0xa3ca847d
uint256 _marketingTax
setDevelopmentWallet 0x72ac2486
address _newDevelopment
setMaxWalletPercentage 0x7a845ece
uint256 _percentage
setSellTaxes 0x0940bbc7
uint256 _marketingTax
setSwapTokensAtAmount 0xafa4f3b2
uint256 _newAmount
setWhitelistStatus 0x0c424284
address _wallet
bool _status
toggleSwapping 0xef586f71
No parameters
transfer 0xa9059cbb
address to
uint256 amount
returns: bool
transferFrom 0x23b872dd
address from
address to
uint256 amount
returns: bool
transferOwnership 0xf2fde38b
address newOwner
withdrawStuckETH 0xf5648a4f
No parameters
withdrawStuckTokens 0xcb963728
address BEP20_token
Recent Transactions
No transactions found for this address