Address Contract Partially Verified
Address
0x1B17DBB40fbED8735E7fE8C9eB02C20984fAdfD6
Balance
0 ETH
Nonce
1
Code Size
9463 bytes
Creator
0xA6e4fFa1...43e7 at tx 0xe1f79bd3...3419b2
Indexed Transactions
0
Contract Bytecode
9463 bytes
0x608060405234801561001057600080fd5b506004361061018e5760003560e01c80638318c444116100de578063b3404efd11610097578063dc1bc51d11610071578063dc1bc51d1461073c578063dd62ed3e1461075c578063f2fde38b146107d4578063f8b43d9c146108185761018e565b8063b3404efd146106e2578063c49c1ef114610700578063d421c5cb1461071e5761018e565b80638318c444146104eb5780638da5cb5b1461054557806395d89b411461057957806395f9df85146105fc578063a457c2d71461061a578063a9059cbb1461067e5761018e565b8063395093511161014b57806370a082311161012557806370a082311461043b578063715018a61461049357806376ff50e31461049d578063801a1467146104a75761018e565b8063395093511461035b57806340c10f19146103bf57806342966c681461040d5761018e565b806306fdde0314610193578063095ea7b31461021657806313e4172c1461027a57806318160ddd1461029857806323b872dd146102b6578063313ce5671461033a575b600080fd5b61019b610836565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156101db5780820151818401526020810190506101c0565b50505050905090810190601f1680156102085780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6102626004803603604081101561022c57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506108d8565b60405180821515815260200191505060405180910390f35b6102826108f6565b6040518082815260200191505060405180910390f35b6102a06108fc565b6040518082815260200191505060405180910390f35b610322600480360360608110156102cc57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610906565b60405180821515815260200191505060405180910390f35b6103426109df565b604051808260ff16815260200191505060405180910390f35b6103a76004803603604081101561037157600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506109f6565b60405180821515815260200191505060405180910390f35b61040b600480360360408110156103d557600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610aa9565b005b6104396004803603602081101561042357600080fd5b8101908080359060200190929190505050610c6f565b005b61047d6004803603602081101561045157600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610d0b565b6040518082815260200191505060405180910390f35b61049b610d54565b005b6104a5610ec1565b005b6104e9600480360360208110156104bd57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611026565b005b61052d6004803603602081101561050157600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506112b2565b60405180821515815260200191505060405180910390f35b61054d6112e2565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b61058161130b565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156105c15780820151818401526020810190506105a6565b50505050905090810190601f1680156105ee5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6106046113ad565b6040518082815260200191505060405180910390f35b6106666004803603604081101561063057600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506113b3565b60405180821515815260200191505060405180910390f35b6106ca6004803603604081101561069457600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050611480565b60405180821515815260200191505060405180910390f35b6106ea61149e565b6040518082815260200191505060405180910390f35b6107086114a4565b6040518082815260200191505060405180910390f35b6107266114aa565b6040518082815260200191505060405180910390f35b6107446114b0565b60405180821515815260200191505060405180910390f35b6107be6004803603604081101561077257600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506114bd565b6040518082815260200191505060405180910390f35b610816600480360360208110156107ea57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611544565b005b610820611736565b6040518082815260200191505060405180910390f35b606060048054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156108ce5780601f106108a3576101008083540402835291602001916108ce565b820191906000526020600020905b8154815290600101906020018083116108b157829003601f168201915b5050505050905090565b60006108ec6108e561186f565b8484611877565b6001905092915050565b60075481565b6000600354905090565b6000610913848484611a6e565b6109d48461091f61186f565b6109cf856040518060600160405280602881526020016123e860289139600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600061098561186f565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611d339092919063ffffffff16565b611877565b600190509392505050565b6000600660009054906101000a900460ff16905090565b6000610a9f610a0361186f565b84610a9a8560026000610a1461186f565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546117e790919063ffffffff16565b611877565b6001905092915050565b610ab161186f565b73ffffffffffffffffffffffffffffffffffffffff16610acf6112e2565b73ffffffffffffffffffffffffffffffffffffffff1614610b58576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b80600754610b7682610b686108fc565b6117e790919063ffffffff16565b1115610bea576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f746f74616c20737570706c79206c696d6974206578636565646564000000000081525060200191505060405180910390fd5b60008211610c60576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600b8152602001807f7a65726f20616d6f756e7400000000000000000000000000000000000000000081525060200191505060405180910390fd5b610c6a8383611ded565b505050565b6000610c7a33610d0b565b905080821115610cf2576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260198152602001807f6e6f7420656e6f75676820746f6b656e7320746f206275726e0000000000000081525060200191505060405180910390fd5b610cfc3383611fb6565b81600754036007819055505050565b6000600160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b610d5c61186f565b73ffffffffffffffffffffffffffffffffffffffff16610d7a6112e2565b73ffffffffffffffffffffffffffffffffffffffff1614610e03576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b610ec961186f565b73ffffffffffffffffffffffffffffffffffffffff16610ee76112e2565b73ffffffffffffffffffffffffffffffffffffffff1614610f70576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b600a544210610fe7576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260178152602001807f7377617020697320616c726561647920616c6c6f77656400000000000000000081525060200191505060405180910390fd5b42600a819055507e2972a20a7d1a7f8292d051e14168b0b7dddcb0e1e493e45dd8fd3791a2a815426040518082815260200191505060405180910390a1565b600a54421015611081576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260238152602001806124566023913960400191505060405180910390fd5b600061109361108e61186f565b610d0b565b9050600081141561110c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601c8152602001807f796f7520646f6e74206861766520746f6b656e7320746f20737761700000000081525060200191505060405180910390fd5b61112860095461111a611736565b61217c90919063ffffffff16565b81111561119d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f796f75722073776170206973206f76657220746865206c696d6974000000000081525060200191505060405180910390fd5b6111b2816009546117e790919063ffffffff16565b6009819055506111c96111c361186f565b82611fb6565b8173ffffffffffffffffffffffffffffffffffffffff1663a4d709626111ed61186f565b836040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050600060405180830381600087803b15801561124157600080fd5b505af1158015611255573d6000803e3d6000fd5b5050505061126161186f565b73ffffffffffffffffffffffffffffffffffffffff167f4fbc02dad9bd3098e9e4f226d6b4d628c079355f397ac31e1795da06b5e375ca826040518082815260200191505060405180910390a25050565b60006112d06009546112c2611736565b61217c90919063ffffffff16565b6112d983610d0b565b11159050919050565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b606060058054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156113a35780601f10611378576101008083540402835291602001916113a3565b820191906000526020600020905b81548152906001019060200180831161138657829003601f168201915b5050505050905090565b600a5481565b60006114766113c061186f565b846114718560405180606001604052806025815260200161249d60259139600260006113ea61186f565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611d339092919063ffffffff16565b611877565b6001905092915050565b600061149461148d61186f565b8484611a6e565b6001905092915050565b600b5481565b60085481565b60095481565b6000600a54421015905090565b6000600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b61154c61186f565b73ffffffffffffffffffffffffffffffffffffffff1661156a6112e2565b73ffffffffffffffffffffffffffffffffffffffff16146115f3576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415611679576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260268152602001806123596026913960400191505060405180910390fd5b8073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a3806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b6000600a5442101561174b57600090506117e4565b611762600b54600a546117e790919063ffffffff16565b421061178b576117846009546117766108fc565b6117e790919063ffffffff16565b90506117e4565b6117e1600b546117d36117a9600a544261217c90919063ffffffff16565b6117c56009546117b76108fc565b6117e790919063ffffffff16565b6121ff90919063ffffffff16565b61228590919063ffffffff16565b90505b90565b600080828401905083811015611865576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f536166654d6174683a206164646974696f6e206f766572666c6f77000000000081525060200191505060405180910390fd5b8091505092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156118fd576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260248152602001806124796024913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611983576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602281526020018061237f6022913960400191505060405180910390fd5b80600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040518082815260200191505060405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611af4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260258152602001806124316025913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611b7a576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260238152602001806123146023913960400191505060405180910390fd5b611b8583838361230e565b611bf1816040518060600160405280602681526020016123a160269139600160008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611d339092919063ffffffff16565b600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611c8681600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546117e790919063ffffffff16565b600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a3505050565b6000838311158290611de0576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b83811015611da5578082015181840152602081019050611d8a565b50505050905090810190601f168015611dd25780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b5082840390509392505050565b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611e90576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601f8152602001807f45524332303a206d696e7420746f20746865207a65726f20616464726573730081525060200191505060405180910390fd5b611e9c6000838361230e565b611eb1816003546117e790919063ffffffff16565b600381905550611f0981600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546117e790919063ffffffff16565b600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff16600073ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a35050565b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16141561203c576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260218152602001806124106021913960400191505060405180910390fd5b6120488260008361230e565b6120b48160405180606001604052806022815260200161233760229139600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611d339092919063ffffffff16565b600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061210c8160035461217c90919063ffffffff16565b600381905550600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a35050565b6000828211156121f4576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601e8152602001807f536166654d6174683a207375627472616374696f6e206f766572666c6f77000081525060200191505060405180910390fd5b818303905092915050565b600080831415612212576000905061227f565b600082840290508284828161222357fe5b041461227a576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260218152602001806123c76021913960400191505060405180910390fd5b809150505b92915050565b60008082116122fc576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601a8152602001807f536166654d6174683a206469766973696f6e206279207a65726f00000000000081525060200191505060405180910390fd5b81838161230557fe5b04905092915050565b50505056fe45524332303a207472616e7366657220746f20746865207a65726f206164647265737345524332303a206275726e20616d6f756e7420657863656564732062616c616e63654f776e61626c653a206e6577206f776e657220697320746865207a65726f206164647265737345524332303a20617070726f766520746f20746865207a65726f206164647265737345524332303a207472616e7366657220616d6f756e7420657863656564732062616c616e6365536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f7745524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e636545524332303a206275726e2066726f6d20746865207a65726f206164647265737345524332303a207472616e736665722066726f6d20746865207a65726f20616464726573737377617070696e6720706572696f6420686173206e6f7420737461727465642079657445524332303a20617070726f76652066726f6d20746865207a65726f206164647265737345524332303a2064656372656173656420616c6c6f77616e63652062656c6f77207a65726fa26469706673582212206c026575bd3fb8a0849f9eacb8341d6a80fb4de409b70a35875bb8403b10bdc164736f6c63430007050033
Verified Source Code Partial Match
Compiler: v0.7.5+commit.eb77ed08
EVM: istanbul
Optimization: No
rUMB1.sol 932 lines
// File: @openzeppelin/contracts/math/SafeMath.sol
// SPDX-License-Identifier: MIT
pragma solidity >=0.6.0 <0.8.0;
/**
* @dev Wrappers over Solidity's arithmetic operations with added overflow
* checks.
*
* Arithmetic operations in Solidity wrap on overflow. This can easily result
* in bugs, because programmers usually assume that an overflow raises an
* error, which is the standard behavior in high level programming languages.
* `SafeMath` restores this intuition by reverting the transaction when an
* operation overflows.
*
* Using this library instead of the unchecked operations eliminates an entire
* class of bugs, so it's recommended to use it always.
*/
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) {
uint256 c = a + b;
if (c < a) return (false, 0);
return (true, c);
}
/**
* @dev Returns the substraction of two unsigned integers, with an overflow flag.
*
* _Available since v3.4._
*/
function trySub(uint256 a, uint256 b) internal pure returns (bool, uint256) {
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) {
// 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) {
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) {
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) {
uint256 c = a + b;
require(c >= a, "SafeMath: addition overflow");
return c;
}
/**
* @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) {
require(b <= a, "SafeMath: subtraction overflow");
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) {
if (a == 0) return 0;
uint256 c = a * b;
require(c / a == b, "SafeMath: multiplication overflow");
return c;
}
/**
* @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. 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) internal pure returns (uint256) {
require(b > 0, "SafeMath: division by zero");
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) {
require(b > 0, "SafeMath: modulo by zero");
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) {
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.
*
* CAUTION: This function is deprecated because it requires allocating memory for the error
* message unnecessarily. For custom revert reasons use {tryDiv}.
*
* 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) {
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) {
require(b > 0, errorMessage);
return a % b;
}
}
// File: @openzeppelin/contracts/utils/Context.sol
pragma solidity >=0.6.0 <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 GSN 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 payable) {
return msg.sender;
}
function _msgData() internal view virtual returns (bytes memory) {
this; // silence state mutability warning without generating bytecode - see https://github.com/ethereum/solidity/issues/2691
return msg.data;
}
}
// File: @openzeppelin/contracts/token/ERC20/IERC20.sol
pragma solidity >=0.6.0 <0.8.0;
/**
* @dev Interface of the ERC20 standard as defined in the EIP.
*/
interface IERC20 {
/**
* @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 `recipient`.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* Emits a {Transfer} event.
*/
function transfer(address recipient, 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 `sender` to `recipient` 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 sender, address recipient, uint256 amount) external returns (bool);
/**
* @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);
}
// File: @openzeppelin/contracts/token/ERC20/ERC20.sol
pragma solidity >=0.6.0 <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.zeppelin.solutions/t/how-to-implement-erc20-supply-mechanisms/226[How
* to implement supply mechanisms].
*
* We have followed general OpenZeppelin guidelines: functions revert instead
* of 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 {
using SafeMath for uint256;
mapping (address => uint256) private _balances;
mapping (address => mapping (address => uint256)) private _allowances;
uint256 private _totalSupply;
string private _name;
string private _symbol;
uint8 private _decimals;
/**
* @dev Sets the values for {name} and {symbol}, initializes {decimals} with
* a default value of 18.
*
* To select a different value for {decimals}, use {_setupDecimals}.
*
* All three of these values are immutable: they can only be set once during
* construction.
*/
constructor (string memory name_, string memory symbol_) public {
_name = name_;
_symbol = symbol_;
_decimals = 18;
}
/**
* @dev Returns the name of the token.
*/
function name() public view virtual returns (string memory) {
return _name;
}
/**
* @dev Returns the symbol of the token, usually a shorter version of the
* name.
*/
function symbol() public view virtual 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 {_setupDecimals} is
* called.
*
* 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 returns (uint8) {
return _decimals;
}
/**
* @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:
*
* - `recipient` cannot be the zero address.
* - the caller must have a balance of at least `amount`.
*/
function transfer(address recipient, uint256 amount) public virtual override returns (bool) {
_transfer(_msgSender(), recipient, 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}.
*
* Requirements:
*
* - `spender` cannot be the zero address.
*/
function approve(address spender, uint256 amount) public virtual override returns (bool) {
_approve(_msgSender(), 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}.
*
* Requirements:
*
* - `sender` and `recipient` cannot be the zero address.
* - `sender` must have a balance of at least `amount`.
* - the caller must have allowance for ``sender``'s tokens of at least
* `amount`.
*/
function transferFrom(address sender, address recipient, uint256 amount) public virtual override returns (bool) {
_transfer(sender, recipient, amount);
_approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance"));
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) {
_approve(_msgSender(), spender, _allowances[_msgSender()][spender].add(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) {
_approve(_msgSender(), spender, _allowances[_msgSender()][spender].sub(subtractedValue, "ERC20: decreased allowance below zero"));
return true;
}
/**
* @dev Moves tokens `amount` from `sender` to `recipient`.
*
* This is 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:
*
* - `sender` cannot be the zero address.
* - `recipient` cannot be the zero address.
* - `sender` must have a balance of at least `amount`.
*/
function _transfer(address sender, address recipient, uint256 amount) internal virtual {
require(sender != address(0), "ERC20: transfer from the zero address");
require(recipient != address(0), "ERC20: transfer to the zero address");
_beforeTokenTransfer(sender, recipient, amount);
_balances[sender] = _balances[sender].sub(amount, "ERC20: transfer amount exceeds balance");
_balances[recipient] = _balances[recipient].add(amount);
emit Transfer(sender, recipient, 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:
*
* - `to` 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 = _totalSupply.add(amount);
_balances[account] = _balances[account].add(amount);
emit Transfer(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);
_balances[account] = _balances[account].sub(amount, "ERC20: burn amount exceeds balance");
_totalSupply = _totalSupply.sub(amount);
emit Transfer(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 Sets {decimals} to a value other than the default one of 18.
*
* WARNING: This function should only be called from the constructor. Most
* applications that interact with token contracts will not expect
* {decimals} to ever change, and may work incorrectly if it does.
*/
function _setupDecimals(uint8 decimals_) internal virtual {
_decimals = decimals_;
}
/**
* @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 to 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 { }
}
// File: @openzeppelin/contracts/access/Ownable.sol
pragma solidity >=0.6.0 <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 () internal {
address msgSender = _msgSender();
_owner = msgSender;
emit OwnershipTransferred(address(0), msgSender);
}
/**
* @dev Returns the address of the current owner.
*/
function owner() public view virtual returns (address) {
return _owner;
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
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 {
emit OwnershipTransferred(_owner, address(0));
_owner = 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");
emit OwnershipTransferred(_owner, newOwner);
_owner = newOwner;
}
}
// File: contracts/interfaces/Owned.sol
pragma solidity 0.7.5;
abstract contract Owned is Ownable {
constructor(address _owner) {
transferOwnership(_owner);
}
}
// File: contracts/interfaces/ISwapReceiver.sol
pragma solidity 0.7.5;
interface ISwapReceiver {
function swapMint(address _holder, uint256 _amount) external;
}
// File: contracts/interfaces/SwappableToken.sol
pragma solidity 0.7.5;
// Inheritance
/// @title Umbrella Rewards contract
/// @author umb.network
/// @notice This contract serves Swap functionality for rewards tokens
/// @dev It allows to swap itself for other token (main UMB token).
/// Swap can start 1y from deployment or can be triggered earlier by owner.
/// There is a daily limit for swapping so we can't swap all at once.
/// When swap is executing, this contract do not care about target token,
/// so target token should be responsible for all the check before he mint tokens for swap.
abstract contract SwappableToken is Owned, ERC20 {
using SafeMath for uint256;
uint256 public totalAmountToBeSwapped;
uint256 public swappedSoFar;
uint256 public swapStartsOn;
uint256 public swapDuration;
// ========== CONSTRUCTOR ========== //
constructor(uint _totalAmountToBeSwapped, uint _swapDuration) {
require(_totalAmountToBeSwapped != 0, "_totalAmountToBeSwapped is empty");
require(_swapDuration != 0, "swapDuration is empty");
totalAmountToBeSwapped = _totalAmountToBeSwapped;
swapStartsOn = block.timestamp + 365 days;
swapDuration = _swapDuration;
}
// ========== MODIFIERS ========== //
// ========== VIEWS ========== //
function isSwapStarted() public view returns (bool) {
return block.timestamp >= swapStartsOn;
}
function canSwapTokens(address _address) public view returns (bool) {
return balanceOf(_address) <= totalUnlockedAmountOfToken().sub(swappedSoFar);
}
function totalUnlockedAmountOfToken() public view returns (uint256) {
if (block.timestamp < swapStartsOn)
return 0;
if (block.timestamp >= swapStartsOn.add(swapDuration)) {
return totalSupply().add(swappedSoFar);
} else {
return totalSupply().add(swappedSoFar).mul(block.timestamp.sub(swapStartsOn)).div(swapDuration);
}
}
// ========== MUTATIVE FUNCTIONS ========== //
function swapFor(ISwapReceiver _umb) external {
require(block.timestamp >= swapStartsOn, "swapping period has not started yet");
uint amountToSwap = balanceOf(_msgSender());
require(amountToSwap != 0, "you dont have tokens to swap");
require(amountToSwap <= totalUnlockedAmountOfToken().sub(swappedSoFar), "your swap is over the limit");
swappedSoFar = swappedSoFar.add(amountToSwap);
_burn(_msgSender(), amountToSwap);
_umb.swapMint(_msgSender(), amountToSwap);
emit LogSwap(_msgSender(), amountToSwap);
}
// ========== PRIVATE / INTERNAL ========== //
// ========== RESTRICTED FUNCTIONS ========== //
function startEarlySwap() external onlyOwner {
require(block.timestamp < swapStartsOn, "swap is already allowed");
swapStartsOn = block.timestamp;
emit LogStartEarlySwapNow(block.timestamp);
}
// ========== EVENTS ========== //
event LogStartEarlySwapNow(uint time);
event LogSwap(address indexed swappedTo, uint amount);
}
// File: contracts/interfaces/IBurnableToken.sol
pragma solidity 0.7.5;
interface IBurnableToken {
function burn(uint256 _amount) external;
}
// File: contracts/interfaces/MintableToken.sol
pragma solidity 0.7.5;
// Inheritance
/// @title Umbrella Rewards contract
/// @author umb.network
/// @notice This contract allows to mint tokens and burn key (renounceOwnership)
/// @dev Can be use used with MultiSig as owner
abstract contract MintableToken is Owned, ERC20, IBurnableToken {
using SafeMath for uint256;
// ========== STATE VARIABLES ========== //
uint256 public maxAllowedTotalSupply;
// ========== CONSTRUCTOR ========== //
constructor (uint256 _maxAllowedTotalSupply) {
require(_maxAllowedTotalSupply != 0, "_maxAllowedTotalSupply is empty");
maxAllowedTotalSupply = _maxAllowedTotalSupply;
}
// ========== MODIFIERS ========== //
modifier assertMaxSupply(uint256 _amountToMint) {
require(totalSupply().add(_amountToMint) <= maxAllowedTotalSupply, "total supply limit exceeded");
_;
}
// ========== MUTATIVE FUNCTIONS ========== //
function burn(uint256 _amount) override external {
uint balance = balanceOf(msg.sender);
require(_amount <= balance, "not enough tokens to burn");
_burn(msg.sender, _amount);
maxAllowedTotalSupply = maxAllowedTotalSupply - _amount;
}
// ========== RESTRICTED FUNCTIONS ========== //
function mint(address _holder, uint256 _amount)
external
onlyOwner()
assertMaxSupply(_amount) {
require(_amount > 0, "zero amount");
_mint(_holder, _amount);
}
}
// File: contracts/interfaces/rUMB.sol
pragma solidity 0.7.5;
// Inheritance
/// @title Umbrella Rewards contract
/// @author umb.network
/// @notice This is reward UMB token (rUMB)
/// @dev Rewards tokens are used for farming and other rewards distributions.
abstract contract rUMB is MintableToken, SwappableToken {
// ========== STATE VARIABLES ========== //
// ========== CONSTRUCTOR ========== //
constructor (
address _owner,
address _initialHolder,
uint256 _initialBalance,
uint256 _maxAllowedTotalSupply,
uint256 _swapDuration,
string memory _name,
string memory _symbol
)
Owned(_owner)
ERC20(_name, _symbol)
MintableToken(_maxAllowedTotalSupply)
SwappableToken(_maxAllowedTotalSupply, _swapDuration) {
if (_initialHolder != address(0) && _initialBalance != 0) {
_mint(_initialHolder, _initialBalance);
}
}
}
// File: contracts/rUMB1.sol
pragma solidity 0.7.5;
contract rUMB1 is rUMB {
constructor (
address _owner,
address _initialHolder,
uint256 _initialBalance,
uint256 _maxAllowedTotalSupply,
uint256 _swapDuration,
string memory _name,
string memory _symbol
)
rUMB(_owner, _initialHolder, _initialBalance, _maxAllowedTotalSupply, _swapDuration, _name, _symbol) {
}
}
Read Contract
allowance 0xdd62ed3e → uint256
balanceOf 0x70a08231 → uint256
canSwapTokens 0x8318c444 → bool
decimals 0x313ce567 → uint8
isSwapStarted 0xdc1bc51d → bool
maxAllowedTotalSupply 0x13e4172c → uint256
name 0x06fdde03 → string
owner 0x8da5cb5b → address
swapDuration 0xb3404efd → uint256
swapStartsOn 0x95f9df85 → uint256
swappedSoFar 0xd421c5cb → uint256
symbol 0x95d89b41 → string
totalAmountToBeSwapped 0xc49c1ef1 → uint256
totalSupply 0x18160ddd → uint256
totalUnlockedAmountOfToken 0xf8b43d9c → uint256
Write Contract 11 functions
These functions modify contract state and require a wallet transaction to execute.
approve 0x095ea7b3
address spender
uint256 amount
returns: bool
burn 0x42966c68
uint256 _amount
decreaseAllowance 0xa457c2d7
address spender
uint256 subtractedValue
returns: bool
increaseAllowance 0x39509351
address spender
uint256 addedValue
returns: bool
mint 0x40c10f19
address _holder
uint256 _amount
renounceOwnership 0x715018a6
No parameters
startEarlySwap 0x76ff50e3
No parameters
swapFor 0x801a1467
address _umb
transfer 0xa9059cbb
address recipient
uint256 amount
returns: bool
transferFrom 0x23b872dd
address sender
address recipient
uint256 amount
returns: bool
transferOwnership 0xf2fde38b
address newOwner
Recent Transactions
No transactions found for this address