Address Contract Partially Verified
Address
0x25BFb48C791F6464de8FcA01542DEc64B83D8199
Balance
0 ETH
Nonce
1
Code Size
8858 bytes
Creator
0xb6f9Fae2...f281 at tx 0xfea9db0a...6aa588
Indexed Transactions
0
Contract Bytecode
8858 bytes
0x608060405234801561001057600080fd5b506004361061020d576000357c0100000000000000000000000000000000000000000000000000000000900480638456cb591161012c578063a9059cbb116100bf578063df0345861161008e578063df0345861461063b578063e2ab691d14610661578063e583983614610693578063f2fde38b146106b95761020d565b8063a9059cbb146105a7578063d18e81b3146105d3578063dd62ed3e146105db578063de6baccb146106095761020d565b8063927a4a7b116100fb578063927a4a7b1461051557806395d89b41146105475780639dc29fac1461054f578063a457c2d71461057b5761020d565b80638456cb59146104915780638a57af6b146104995780638d1fdf2f146104cb5780638da5cb5b146104f15761020d565b80633f4ba83a116101a45780635c975abb116101735780635c975abb1461042f57806370a0823114610437578063715018a61461045d5780637eee288d146104655761020d565b80633f4ba83a1461038e57806340c10f191461039857806345c8b1a6146103c457806346cf1bb5146103ea5761020d565b806323b872dd116101e057806323b872dd14610306578063313ce5671461033c578063378dc3dc1461035a57806339509351146103625761020d565b806304859ceb1461021257806306fdde0314610241578063095ea7b3146102be57806318160ddd146102fe575b600080fd5b61022f6004803603602081101561022857600080fd5b50356106df565b60408051918252519081900360200190f35b6102496106e4565b6040805160208082528351818301528351919283929083019185019080838360005b8381101561028357818101518382015260200161026b565b50505050905090810190601f1680156102b05780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6102ea600480360360408110156102d457600080fd5b50600160a060020a03813516906020013561071b565b604080519115158252519081900360200190f35b61022f610799565b6102ea6004803603606081101561031c57600080fd5b50600160a060020a038135811691602081013590911690604001356107a0565b610344610892565b6040805160ff9092168252519081900360200190f35b61022f610897565b6102ea6004803603604081101561037857600080fd5b50600160a060020a0381351690602001356108a7565b610396610957565b005b6102ea600480360360408110156103ae57600080fd5b50600160a060020a038135169060200135610a53565b610396600480360360208110156103da57600080fd5b5035600160a060020a0316610af8565b6104166004803603604081101561040057600080fd5b50600160a060020a038135169060200135610ba0565b6040805192835260208301919091528051918290030190f35b6102ea610c19565b61022f6004803603602081101561044d57600080fd5b5035600160a060020a0316610c29565b610396610cc3565b6103966004803603604081101561047b57600080fd5b50600160a060020a038135169060200135610d6a565b610396611019565b610396600480360360608110156104af57600080fd5b50600160a060020a03813516906020810135906040013561111a565b610396600480360360208110156104e157600080fd5b5035600160a060020a031661127d565b6104f9611328565b60408051600160a060020a039092168252519081900360200190f35b6102ea6004803603606081101561052b57600080fd5b50600160a060020a038135169060208101359060400135611337565b610249611546565b6103966004803603604081101561056557600080fd5b50600160a060020a03813516906020013561157d565b6102ea6004803603604081101561059157600080fd5b50600160a060020a03813516906020013561167a565b6102ea600480360360408110156105bd57600080fd5b50600160a060020a0381351690602001356116c5565b61022f6117a2565b61022f600480360360408110156105f157600080fd5b50600160a060020a03813581169160200135166117a6565b6102ea6004803603606081101561061f57600080fd5b50600160a060020a0381351690602081013590604001356117d1565b61022f6004803603602081101561065157600080fd5b5035600160a060020a03166119dd565b6103966004803603606081101561067757600080fd5b50600160a060020a0381351690602081013590604001356119f8565b6102ea600480360360208110156106a957600080fd5b5035600160a060020a0316611b54565b610396600480360360208110156106cf57600080fd5b5035600160a060020a0316611b72565b420190565b60408051808201909152600581527f5570436172000000000000000000000000000000000000000000000000000000602082015281565b6000600160a060020a038316151561073257600080fd5b336000818152600160209081526040808320600160a060020a03881680855290835292819020869055805186815290519293927f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925929181900390910190a350600192915050565b6002545b90565b60035460009060a060020a900460ff1615610805576040805160e560020a62461bcd02815260206004820152600f60248201527f506175736564206279206f776e65720000000000000000000000000000000000604482015290519081900360640190fd5b600160a060020a03841660009081526004602052604090205460ff1615610876576040805160e560020a62461bcd02815260206004820152601760248201527f46726f6d206163636f756e74206973206c6f636b65642e000000000000000000604482015290519081900360640190fd5b61087f84611bce565b61088a848484611df2565b949350505050565b601281565b6b033b2e3c9fd0803ce800000081565b6000600160a060020a03831615156108be57600080fd5b336000908152600160209081526040808320600160a060020a03871684529091529020546108f2908363ffffffff611ebb16565b336000818152600160209081526040808320600160a060020a0389168085529083529281902085905580519485525191937f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925929081900390910190a350600192915050565b600354600160a060020a031633146109a7576040805160e560020a62461bcd028152602060048201526009602482015260008051602061220f833981519152604482015290519081900360640190fd5b60035460a060020a900460ff161515610a0a576040805160e560020a62461bcd02815260206004820152600e60248201527f4e6f7420706175736564206e6f77000000000000000000000000000000000000604482015290519081900360640190fd5b6003805474ff0000000000000000000000000000000000000000191690556040517f7805862f689e2f13df9f062ff482ad3ad112aca9e0847911ed832e158c525b3390600090a1565b600354600090600160a060020a03163314610aa6576040805160e560020a62461bcd028152602060048201526009602482015260008051602061220f833981519152604482015290519081900360640190fd5b610ab08383611ecd565b604080518381529051600160a060020a038516917f0f6798a560793a54c3bcfe86a93cde1e73087d944c0ea20544137d4121396885919081900360200190a250600192915050565b600354600160a060020a03163314610b48576040805160e560020a62461bcd028152602060048201526009602482015260008051602061220f833981519152604482015290519081900360640190fd5b600160a060020a038116600081815260046020908152604091829020805460ff19169055815192835290517f4feb53e305297ab8fb8f3420c95ea04737addc254a7270d8fc4605d2b9c61dba9281900390910190a150565b600160a060020a0382166000908152600560205260408120805482919084908110610bc757fe5b60009182526020808320600290920290910154600160a060020a038716835260059091526040909120805485908110610bfc57fe5b906000526020600020906002020160010154915091509250929050565b60035460a060020a900460ff1681565b600080805b600160a060020a038416600090815260056020526040902054811015610ca257600160a060020a03841660009081526005602052604090208054610c98919083908110610c7757fe5b90600052602060002090600202016001015483611ebb90919063ffffffff16565b9150600101610c2e565b50610cbc81610cb085611f65565b9063ffffffff611ebb16565b9392505050565b600354600160a060020a03163314610d13576040805160e560020a62461bcd028152602060048201526009602482015260008051602061220f833981519152604482015290519081900360640190fd5b600354604051600160a060020a03909116907ff8df31144d9c2f0f6b59d69b8b98abd5459d07f2742c4df920b25aae33c6482090600090a26003805473ffffffffffffffffffffffffffffffffffffffff19169055565b600354600160a060020a03163314610dba576040805160e560020a62461bcd028152602060048201526009602482015260008051602061220f833981519152604482015290519081900360640190fd5b600160a060020a0382166000908152600560205260409020548110610e29576040805160e560020a62461bcd02815260206004820152601460248201527f4e6f206c6f636b20696e666f726d6174696f6e2e000000000000000000000000604482015290519081900360640190fd5b600160a060020a03821660009081526005602052604090208054610e8b919083908110610e5257fe5b6000918252602080832060016002909302019190910154600160a060020a0386168352908290526040909120549063ffffffff611ebb16565b600160a060020a03831660008181526020818152604080832094909455600590529190912080547f6381d9813cabeb57471b5a7e05078e64845ccdb563146a6911d536f24ce960f1919084908110610edf57fe5b9060005260206000209060020201600101546040518082815260200191505060405180910390a2600160a060020a0382166000908152600560205260408120805483908110610f2a57fe5b6000918252602080832060016002909302019190910192909255600160a060020a038416815260059091526040902054600019018114610feb57600160a060020a038216600090815260056020526040902080546000198101908110610f8c57fe5b90600052602060002090600202016005600084600160a060020a0316600160a060020a0316815260200190815260200160002082815481101515610fcc57fe5b6000918252602090912082546002909202019081556001918201549101555b600160a060020a03821660009081526005602052604090208054906110149060001983016121c6565b505050565b600354600160a060020a03163314611069576040805160e560020a62461bcd028152602060048201526009602482015260008051602061220f833981519152604482015290519081900360640190fd5b60035460a060020a900460ff16156110cb576040805160e560020a62461bcd02815260206004820152600f60248201527f506175736564206279206f776e65720000000000000000000000000000000000604482015290519081900360640190fd5b6003805474ff0000000000000000000000000000000000000000191660a060020a1790556040517f6985a02210a168e66602d3235cb6db0e70f92b3ba4d376a33c0f3d9434bff62590600090a1565b600354600160a060020a0316331461116a576040805160e560020a62461bcd028152602060048201526009602482015260008051602061220f833981519152604482015290519081900360640190fd5b8161117484611f65565b10156111ca576040805160e560020a62461bcd02815260206004820152601560248201527f42616c616e636520697320746f6f20736d616c6c2e0000000000000000000000604482015290519081900360640190fd5b600160a060020a0383166000908152602081905260409020546111f3908363ffffffff611f8016565b600160a060020a0384166000818152602081815260408083209490945560058152838220845180860186524287018082528184018981528354600181810186559487529585902092516002909602909201948555905193909101929092558351868152908101919091528251919260008051602061224f83398151915292918290030190a2505050565b600354600160a060020a031633146112cd576040805160e560020a62461bcd028152602060048201526009602482015260008051602061220f833981519152604482015290519081900360640190fd5b600160a060020a038116600081815260046020908152604091829020805460ff19166001179055815192835290517f8a5c4736a33c7b7f29a2c34ea9ff9608afc5718d56f6fd6dcbd2d3711a1a49139281900390910190a150565b600354600160a060020a031681565b600354600090600160a060020a0316331461138a576040805160e560020a62461bcd028152602060048201526009602482015260008051602061220f833981519152604482015290519081900360640190fd5b600160a060020a03841615156113ea576040805160e560020a62461bcd02815260206004820152600d60248201527f77726f6e67206164647265737300000000000000000000000000000000000000604482015290519081900360640190fd5b6003546113ff90600160a060020a0316611f65565b831115611456576040805160e560020a62461bcd02815260206004820152601260248201527f4e6f7420656e6f7567682062616c616e63650000000000000000000000000000604482015290519081900360640190fd5b600354600160a060020a0316600090815260208190526040902054611481908463ffffffff611f8016565b60038054600160a060020a03908116600090815260208181526040808320959095558883168083526005825285832086518088018852428a0181528084018b8152825460018181018555938752958590209151600290960290910194855551930192909255925484518881529451919492169260008051602061222f833981519152928290030190a36040805184815242840160208201528151600160a060020a0387169260008051602061224f833981519152928290030190a25060019392505050565b60408051808201909152600381527f5550430000000000000000000000000000000000000000000000000000000000602082015281565b600354600160a060020a031633146115cd576040805160e560020a62461bcd028152602060048201526009602482015260008051602061220f833981519152604482015290519081900360640190fd5b6115d682611f65565b81111561162d576040805160e560020a62461bcd02815260206004820152601560248201527f42616c616e636520697320746f6f20736d616c6c2e0000000000000000000000604482015290519081900360640190fd5b6116378282611f95565b604080518281529051600160a060020a038416917fcc16f5dbb4873280815c1ee09dbd06736cffcc184412cf7a71a0fdb75d397ca5919081900360200190a25050565b6000600160a060020a038316151561169157600080fd5b336000908152600160209081526040808320600160a060020a03871684529091529020546108f2908363ffffffff611f8016565b3360009081526004602052604081205460ff161561172d576040805160e560020a62461bcd02815260206004820152601960248201527f53656e646572206163636f756e74206973206c6f636b65642e00000000000000604482015290519081900360640190fd5b60035460a060020a900460ff161561178f576040805160e560020a62461bcd02815260206004820152600f60248201527f506175736564206279206f776e65720000000000000000000000000000000000604482015290519081900360640190fd5b61179833611bce565b610cbc838361202c565b4290565b600160a060020a03918216600090815260016020908152604080832093909416825291909152205490565b600354600090600160a060020a03163314611824576040805160e560020a62461bcd028152602060048201526009602482015260008051602061220f833981519152604482015290519081900360640190fd5b600160a060020a0384161515611884576040805160e560020a62461bcd02815260206004820152600d60248201527f77726f6e67206164647265737300000000000000000000000000000000000000604482015290519081900360640190fd5b60035461189990600160a060020a0316611f65565b8311156118f0576040805160e560020a62461bcd02815260206004820152601260248201527f4e6f7420656e6f7567682062616c616e63650000000000000000000000000000604482015290519081900360640190fd5b600354600160a060020a031660009081526020819052604090205461191b908463ffffffff611f8016565b60038054600160a060020a039081166000908152602081815260408083209590955588831680835260058252858320865180880188528981528084018b8152825460018181018555938752958590209151600290960290910194855551930192909255925484518881529451919492169260008051602061222f833981519152928290030190a360408051848152602081018490528151600160a060020a0387169260008051602061224f833981519152928290030190a25060019392505050565b600160a060020a031660009081526005602052604090205490565b600354600160a060020a03163314611a48576040805160e560020a62461bcd028152602060048201526009602482015260008051602061220f833981519152604482015290519081900360640190fd5b81611a5284611f65565b1015611aa8576040805160e560020a62461bcd02815260206004820152601560248201527f42616c616e636520697320746f6f20736d616c6c2e0000000000000000000000604482015290519081900360640190fd5b600160a060020a038316600090815260208190526040902054611ad1908363ffffffff611f8016565b600160a060020a03841660008181526020818152604080832094909455600581528382208451808601865286815280830188815282546001818101855593865294849020915160029095029091019384555192019190915582518581529081018490528251919260008051602061224f83398151915292918290030190a2505050565b600160a060020a031660009081526004602052604090205460ff1690565b600354600160a060020a03163314611bc2576040805160e560020a62461bcd028152602060048201526009602482015260008051602061220f833981519152604482015290519081900360640190fd5b611bcb81612042565b50565b60005b600160a060020a038216600090815260056020526040902054811015611dee57600160a060020a0382166000908152600560205260409020805442919083908110611c1857fe5b600091825260209091206002909102015411611de657600160a060020a03821660009081526005602052604090208054611c57919083908110610e5257fe5b600160a060020a03831660008181526020818152604080832094909455600590529190912080547f6381d9813cabeb57471b5a7e05078e64845ccdb563146a6911d536f24ce960f1919084908110611cab57fe5b9060005260206000209060020201600101546040518082815260200191505060405180910390a2600160a060020a0382166000908152600560205260408120805483908110611cf657fe5b6000918252602080832060016002909302019190910192909255600160a060020a038416815260059091526040902054600019018114611dbb57600160a060020a038216600090815260056020526040902080546000198101908110611d5857fe5b90600052602060002090600202016005600084600160a060020a0316600160a060020a0316815260200190815260200160002082815481101515611d9857fe5b600091825260209091208254600290920201908155600191820154910155600019015b600160a060020a0382166000908152600560205260409020805490611de49060001983016121c6565b505b600101611bd1565b5050565b600160a060020a0383166000908152600160209081526040808320338452909152812054611e26908363ffffffff611f8016565b600160a060020a0385166000908152600160209081526040808320338452909152902055611e5584848461210b565b600160a060020a0384166000818152600160209081526040808320338085529083529281902054815190815290519293927f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925929181900390910190a35060019392505050565b600082820183811015610cbc57600080fd5b600160a060020a0382161515611ee257600080fd5b600254611ef5908263ffffffff611ebb16565b600255600160a060020a038216600090815260208190526040902054611f21908263ffffffff611ebb16565b600160a060020a03831660008181526020818152604080832094909455835185815293519293919260008051602061222f8339815191529281900390910190a35050565b600160a060020a031660009081526020819052604090205490565b600082821115611f8f57600080fd5b50900390565b600160a060020a0382161515611faa57600080fd5b600254611fbd908263ffffffff611f8016565b600255600160a060020a038216600090815260208190526040902054611fe9908263ffffffff611f8016565b600160a060020a0383166000818152602081815260408083209490945583518581529351919360008051602061222f833981519152929081900390910190a35050565b600061203933848461210b565b50600192915050565b600160a060020a03811615156120a2576040805160e560020a62461bcd02815260206004820152600d60248201527f416c7265616479206f776e657200000000000000000000000000000000000000604482015290519081900360640190fd5b600354604051600160a060020a038084169216907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a36003805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0392909216919091179055565b600160a060020a038216151561212057600080fd5b600160a060020a038316600090815260208190526040902054612149908263ffffffff611f8016565b600160a060020a03808516600090815260208190526040808220939093559084168152205461217e908263ffffffff611ebb16565b600160a060020a0380841660008181526020818152604091829020949094558051858152905191939287169260008051602061222f83398151915292918290030190a3505050565b815481835581811115611014576000838152602090206110149161079d9160029182028101918502015b8082111561220a57600080825560018201556002016121f0565b509056fe4e6f74206f776e65720000000000000000000000000000000000000000000000ddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef49eaf4942f1237055eb4cfa5f31c9dfe50d5b4ade01e021f7de8be2fbbde557ba165627a7a723058204837f28eb32acb2f8fa1a589fa4a735571f2652c3dbd30ea79db94640ca7737c0029
Verified Source Code Partial Match
Compiler: v0.5.4+commit.9549d8ff
EVM: byzantium
Optimization: Yes (200 runs)
UpCar.sol 558 lines
pragma solidity ^0.5.4;
// File: node_modules/openzeppelin-solidity/contracts/token/ERC20/IERC20.sol
/**
* @title ERC20 interface
* @dev see https://github.com/ethereum/EIPs/issues/20
*/
interface IERC20 {
function transfer(address to, uint256 value) external returns (bool);
function approve(address spender, uint256 value) external returns (bool);
function transferFrom(address from, address to, uint256 value) external returns (bool);
function totalSupply() external view returns (uint256);
function balanceOf(address who) external view returns (uint256);
function allowance(address owner, address spender) external view returns (uint256);
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(address indexed owner, address indexed spender, uint256 value);
}
// File: node_modules/openzeppelin-solidity/contracts/math/SafeMath.sol
/**
* @title SafeMath
* @dev Unsigned math operations with safety checks that revert on error
*/
library SafeMath {
/**
* @dev Multiplies two unsigned integers, reverts on overflow.
*/
function mul(uint256 a, uint256 b) internal pure returns (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-solidity/pull/522
if (a == 0) {
return 0;
}
uint256 c = a * b;
require(c / a == b);
return c;
}
/**
* @dev Integer division of two unsigned integers truncating the quotient, reverts on division by zero.
*/
function div(uint256 a, uint256 b) internal pure returns (uint256) {
// Solidity only automatically asserts when dividing by 0
require(b > 0);
uint256 c = a / b;
// assert(a == b * c + a % b); // There is no case in which this doesn't hold
return c;
}
/**
* @dev Subtracts two unsigned integers, reverts on overflow (i.e. if subtrahend is greater than minuend).
*/
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
require(b <= a);
uint256 c = a - b;
return c;
}
/**
* @dev Adds two unsigned integers, reverts on overflow.
*/
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a);
return c;
}
/**
* @dev Divides two unsigned integers and returns the remainder (unsigned integer modulo),
* reverts when dividing by zero.
*/
function mod(uint256 a, uint256 b) internal pure returns (uint256) {
require(b != 0);
return a % b;
}
}
// File: node_modules/openzeppelin-solidity/contracts/token/ERC20/ERC20.sol
/**
* @title Standard ERC20 token
*
* @dev Implementation of the basic standard token.
* https://github.com/ethereum/EIPs/blob/master/EIPS/eip-20.md
* Originally based on code by FirstBlood:
* https://github.com/Firstbloodio/token/blob/master/smart_contract/FirstBloodToken.sol
*
* This implementation emits additional Approval events, allowing applications to reconstruct the allowance status for
* all accounts just by listening to said events. Note that this isn't required by the specification, and other
* compliant implementations may not do it.
*/
contract ERC20 is IERC20 {
using SafeMath for uint256;
mapping (address => uint256) internal _balances;
mapping (address => mapping (address => uint256)) private _allowed;
uint256 private _totalSupply;
/**
* @dev Total number of tokens in existence
*/
function totalSupply() public view returns (uint256) {
return _totalSupply;
}
/**
* @dev Gets the balance of the specified address.
* @param owner The address to query the balance of.
* @return An uint256 representing the amount owned by the passed address.
*/
function balanceOf(address owner) public view returns (uint256) {
return _balances[owner];
}
/**
* @dev Function to check the amount of tokens that an owner allowed to a spender.
* @param owner address The address which owns the funds.
* @param spender address The address which will spend the funds.
* @return A uint256 specifying the amount of tokens still available for the spender.
*/
function allowance(address owner, address spender) public view returns (uint256) {
return _allowed[owner][spender];
}
/**
* @dev Transfer token for a specified address
* @param to The address to transfer to.
* @param value The amount to be transferred.
*/
function transfer(address to, uint256 value) public returns (bool) {
_transfer(msg.sender, to, value);
return true;
}
/**
* @dev Approve the passed address to spend the specified amount of tokens on behalf of msg.sender.
* 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
* @param spender The address which will spend the funds.
* @param value The amount of tokens to be spent.
*/
function approve(address spender, uint256 value) public returns (bool) {
require(spender != address(0));
_allowed[msg.sender][spender] = value;
emit Approval(msg.sender, spender, value);
return true;
}
/**
* @dev Transfer tokens from one address to another.
* Note that while this function emits an Approval event, this is not required as per the specification,
* and other compliant implementations may not emit the event.
* @param from address The address which you want to send tokens from
* @param to address The address which you want to transfer to
* @param value uint256 the amount of tokens to be transferred
*/
function transferFrom(address from, address to, uint256 value) public returns (bool) {
_allowed[from][msg.sender] = _allowed[from][msg.sender].sub(value);
_transfer(from, to, value);
emit Approval(from, msg.sender, _allowed[from][msg.sender]);
return true;
}
/**
* @dev Increase the amount of tokens that an owner allowed to a spender.
* approve should be called when allowed_[_spender] == 0. To increment
* allowed value is better to use this function to avoid 2 calls (and wait until
* the first transaction is UpCard)
* From MonolithDAO Token.sol
* Emits an Approval event.
* @param spender The address which will spend the funds.
* @param addedValue The amount of tokens to increase the allowance by.
*/
function increaseAllowance(address spender, uint256 addedValue) public returns (bool) {
require(spender != address(0));
_allowed[msg.sender][spender] = _allowed[msg.sender][spender].add(addedValue);
emit Approval(msg.sender, spender, _allowed[msg.sender][spender]);
return true;
}
/**
* @dev Decrease the amount of tokens that an owner allowed to a spender.
* approve should be called when allowed_[_spender] == 0. To decrement
* allowed value is better to use this function to avoid 2 calls (and wait until
* the first transaction is UpCard)
* From MonolithDAO Token.sol
* Emits an Approval event.
* @param spender The address which will spend the funds.
* @param subtractedValue The amount of tokens to decrease the allowance by.
*/
function decreaseAllowance(address spender, uint256 subtractedValue) public returns (bool) {
require(spender != address(0));
_allowed[msg.sender][spender] = _allowed[msg.sender][spender].sub(subtractedValue);
emit Approval(msg.sender, spender, _allowed[msg.sender][spender]);
return true;
}
/**
* @dev Transfer token for a specified addresses
* @param from The address to transfer from.
* @param to The address to transfer to.
* @param value The amount to be transferred.
*/
function _transfer(address from, address to, uint256 value) internal {
require(to != address(0));
_balances[from] = _balances[from].sub(value);
_balances[to] = _balances[to].add(value);
emit Transfer(from, to, value);
}
/**
* @dev Internal function that mints an amount of the token and assigns it to
* an account. This encapsulates the modification of balances such that the
* proper events are emitted.
* @param account The account that will receive the created tokens.
* @param value The amount that will be created.
*/
function _mint(address account, uint256 value) internal {
require(account != address(0));
_totalSupply = _totalSupply.add(value);
_balances[account] = _balances[account].add(value);
emit Transfer(address(0), account, value);
}
/**
* @dev Internal function that burns an amount of the token of a given
* account.
* @param account The account whose tokens will be burnt.
* @param value The amount that will be burnt.
*/
function _burn(address account, uint256 value) internal {
require(account != address(0));
_totalSupply = _totalSupply.sub(value);
_balances[account] = _balances[account].sub(value);
emit Transfer(account, address(0), value);
}
/**
* @dev Internal function that burns an amount of the token of a given
* account, deducting from the sender's allowance for said account. Uses the
* internal burn function.
* Emits an Approval event (reflecting the reduced allowance).
* @param account The account whose tokens will be burnt.
* @param value The amount that will be burnt.
*/
function _burnFrom(address account, uint256 value) internal {
_allowed[account][msg.sender] = _allowed[account][msg.sender].sub(value);
_burn(account, value);
emit Approval(account, msg.sender, _allowed[account][msg.sender]);
}
}
contract UpCar is ERC20 {
string public constant name = "UpCar"; // solium-disable-line uppercase
string public constant symbol = "UPC"; // solium-disable-line uppercase
uint8 public constant decimals = 18; // solium-disable-line uppercase
uint256 public constant initialSupply = 1000000000 * (10 ** uint256(decimals));
constructor() public {
super._mint(msg.sender, initialSupply);
owner = msg.sender;
}
//ownership
address public owner;
event OwnershipRenounced(address indexed previousOwner);
event OwnershipTransferred(
address indexed previousOwner,
address indexed newOwner
);
modifier onlyOwner() {
require(msg.sender == owner, "Not owner");
_;
}
/**
* @dev Allows the current owner to relinquish control of the contract.
* @notice Renouncing to ownership will leave the contract without an owner.
* It will not be possible to call the functions with the `onlyOwner`
* modifier anymore.
*/
function renounceOwnership() public onlyOwner {
emit OwnershipRenounced(owner);
owner = address(0);
}
/**
* @dev Allows the current owner to transfer control of the contract to a newOwner.
* @param _newOwner The address to transfer ownership to.
*/
function transferOwnership(address _newOwner) public onlyOwner {
_transferOwnership(_newOwner);
}
/**
* @dev Transfers control of the contract to a newOwner.
* @param _newOwner The address to transfer ownership to.
*/
function _transferOwnership(address _newOwner) internal {
require(_newOwner != address(0), "Already owner");
emit OwnershipTransferred(owner, _newOwner);
owner = _newOwner;
}
//pausable
event Pause();
event Unpause();
bool public paused = false;
/**
* @dev Modifier to make a function callable only when the contract is not paused.
*/
modifier whenNotPaused() {
require(!paused, "Paused by owner");
_;
}
/**
* @dev Modifier to make a function callable only when the contract is paused.
*/
modifier whenPaused() {
require(paused, "Not paused now");
_;
}
/**
* @dev called by the owner to pause, triggers stopped state
*/
function pause() public onlyOwner whenNotPaused {
paused = true;
emit Pause();
}
/**
* @dev called by the owner to unpause, returns to normal state
*/
function unpause() public onlyOwner whenPaused {
paused = false;
emit Unpause();
}
//freezable
event Frozen(address target);
event Unfrozen(address target);
mapping(address => bool) internal freezes;
modifier whenNotFrozen() {
require(!freezes[msg.sender], "Sender account is locked.");
_;
}
function freeze(address _target) public onlyOwner {
freezes[_target] = true;
emit Frozen(_target);
}
function unfreeze(address _target) public onlyOwner {
freezes[_target] = false;
emit Unfrozen(_target);
}
function isFrozen(address _target) public view returns (bool) {
return freezes[_target];
}
function transfer(
address _to,
uint256 _value
)
public
whenNotFrozen
whenNotPaused
returns (bool)
{
releaseLock(msg.sender);
return super.transfer(_to, _value);
}
function transferFrom(
address _from,
address _to,
uint256 _value
)
public
whenNotPaused
returns (bool)
{
require(!freezes[_from], "From account is locked.");
releaseLock(_from);
return super.transferFrom(_from, _to, _value);
}
//mintable
event Mint(address indexed to, uint256 amount);
function mint(
address _to,
uint256 _amount
)
public
onlyOwner
returns (bool)
{
super._mint(_to, _amount);
emit Mint(_to, _amount);
return true;
}
//burnable
event Burn(address indexed burner, uint256 value);
function burn(address _who, uint256 _value) public onlyOwner {
require(_value <= super.balanceOf(_who), "Balance is too small.");
_burn(_who, _value);
emit Burn(_who, _value);
}
//lockable
struct LockInfo {
uint256 releaseTime;
uint256 balance;
}
mapping(address => LockInfo[]) internal lockInfo;
event Lock(address indexed holder, uint256 value, uint256 releaseTime);
event Unlock(address indexed holder, uint256 value);
function balanceOf(address _holder) public view returns (uint256 balance) {
uint256 lockedBalance = 0;
for(uint256 i = 0; i < lockInfo[_holder].length ; i++ ) {
lockedBalance = lockedBalance.add(lockInfo[_holder][i].balance);
}
return super.balanceOf(_holder).add(lockedBalance);
}
function releaseLock(address _holder) internal {
for(uint256 i = 0; i < lockInfo[_holder].length ; i++ ) {
if (lockInfo[_holder][i].releaseTime <= now) {
_balances[_holder] = _balances[_holder].add(lockInfo[_holder][i].balance);
emit Unlock(_holder, lockInfo[_holder][i].balance);
lockInfo[_holder][i].balance = 0;
if (i != lockInfo[_holder].length - 1) {
lockInfo[_holder][i] = lockInfo[_holder][lockInfo[_holder].length - 1];
i--;
}
lockInfo[_holder].length--;
}
}
}
function lockCount(address _holder) public view returns (uint256) {
return lockInfo[_holder].length;
}
function lockState(address _holder, uint256 _idx) public view returns (uint256, uint256) {
return (lockInfo[_holder][_idx].releaseTime, lockInfo[_holder][_idx].balance);
}
function lock(address _holder, uint256 _amount, uint256 _releaseTime) public onlyOwner {
require(super.balanceOf(_holder) >= _amount, "Balance is too small.");
_balances[_holder] = _balances[_holder].sub(_amount);
lockInfo[_holder].push(
LockInfo(_releaseTime, _amount)
);
emit Lock(_holder, _amount, _releaseTime);
}
function lockAfter(address _holder, uint256 _amount, uint256 _afterTime) public onlyOwner {
require(super.balanceOf(_holder) >= _amount, "Balance is too small.");
_balances[_holder] = _balances[_holder].sub(_amount);
lockInfo[_holder].push(
LockInfo(now + _afterTime, _amount)
);
emit Lock(_holder, _amount, now + _afterTime);
}
function unlock(address _holder, uint256 i) public onlyOwner {
require(i < lockInfo[_holder].length, "No lock information.");
_balances[_holder] = _balances[_holder].add(lockInfo[_holder][i].balance);
emit Unlock(_holder, lockInfo[_holder][i].balance);
lockInfo[_holder][i].balance = 0;
if (i != lockInfo[_holder].length - 1) {
lockInfo[_holder][i] = lockInfo[_holder][lockInfo[_holder].length - 1];
}
lockInfo[_holder].length--;
}
function transferWithLock(address _to, uint256 _value, uint256 _releaseTime) public onlyOwner returns (bool) {
require(_to != address(0), "wrong address");
require(_value <= super.balanceOf(owner), "Not enough balance");
_balances[owner] = _balances[owner].sub(_value);
lockInfo[_to].push(
LockInfo(_releaseTime, _value)
);
emit Transfer(owner, _to, _value);
emit Lock(_to, _value, _releaseTime);
return true;
}
function transferWithLockAfter(address _to, uint256 _value, uint256 _afterTime) public onlyOwner returns (bool) {
require(_to != address(0), "wrong address");
require(_value <= super.balanceOf(owner), "Not enough balance");
_balances[owner] = _balances[owner].sub(_value);
lockInfo[_to].push(
LockInfo(now + _afterTime, _value)
);
emit Transfer(owner, _to, _value);
emit Lock(_to, _value, now + _afterTime);
return true;
}
function currentTime() public view returns (uint256) {
return now;
}
function afterTime(uint256 _value) public view returns (uint256) {
return now + _value;
}
}
Read Contract
afterTime 0x04859ceb → uint256
allowance 0xdd62ed3e → uint256
balanceOf 0x70a08231 → uint256
currentTime 0xd18e81b3 → uint256
decimals 0x313ce567 → uint8
initialSupply 0x378dc3dc → uint256
isFrozen 0xe5839836 → bool
lockCount 0xdf034586 → uint256
lockState 0x46cf1bb5 → uint256, uint256
name 0x06fdde03 → string
owner 0x8da5cb5b → address
paused 0x5c975abb → bool
symbol 0x95d89b41 → string
totalSupply 0x18160ddd → uint256
Write Contract 18 functions
These functions modify contract state and require a wallet transaction to execute.
approve 0x095ea7b3
address spender
uint256 value
returns: bool
burn 0x9dc29fac
address _who
uint256 _value
decreaseAllowance 0xa457c2d7
address spender
uint256 subtractedValue
returns: bool
freeze 0x8d1fdf2f
address _target
increaseAllowance 0x39509351
address spender
uint256 addedValue
returns: bool
lock 0xe2ab691d
address _holder
uint256 _amount
uint256 _releaseTime
lockAfter 0x8a57af6b
address _holder
uint256 _amount
uint256 _afterTime
mint 0x40c10f19
address _to
uint256 _amount
returns: bool
pause 0x8456cb59
No parameters
renounceOwnership 0x715018a6
No parameters
transfer 0xa9059cbb
address _to
uint256 _value
returns: bool
transferFrom 0x23b872dd
address _from
address _to
uint256 _value
returns: bool
transferOwnership 0xf2fde38b
address _newOwner
transferWithLock 0xde6baccb
address _to
uint256 _value
uint256 _releaseTime
returns: bool
transferWithLockAfter 0x927a4a7b
address _to
uint256 _value
uint256 _afterTime
returns: bool
unfreeze 0x45c8b1a6
address _target
unlock 0x7eee288d
address _holder
uint256 i
unpause 0x3f4ba83a
No parameters
Recent Transactions
No transactions found for this address