Address Contract Partially Verified
Address
0x53Cf4694B427FcEf9BB1F4438B68dF51A10228D0
Balance
0 ETH
Nonce
1
Code Size
3714 bytes
Creator
0x0D04146B...D22f at tx 0x311a30a1...ac8d87
Indexed Transactions
0
Contract Bytecode
3714 bytes
0x608060405234801561001057600080fd5b50600436106101005760003560e01c80634e71e0c8116100975780639dc29fac116100665780639dc29fac146101dd578063a9059cbb146101f0578063dd62ed3e14610203578063f2fde38b1461021657610100565b80634e71e0c8146101b257806370a08231146101ba5780638456db15146101cd57806395d89b41146101d557610100565b806318160ddd116100d357806318160ddd1461016057806323b872dd14610175578063313ce5671461018857806340c10f191461019d57610100565b806306fdde0314610105578063095ea7b31461012357806313096a411461014357806316048bc414610158575b600080fd5b61010d610229565b60405161011a9190610c89565b60405180910390f35b610136610131366004610b56565b6102f6565b60405161011a9190610c7e565b61014b610361565b60405161011a9190610c6a565b61014b610370565b61016861037f565b60405161011a9190610dcd565b610136610183366004610b16565b610385565b610190610509565b60405161011a9190610dd6565b6101b06101ab366004610b56565b61058b565b005b6101b061068e565b6101686101c8366004610ac7565b61071c565b61014b610737565b61010d610746565b6101b06101eb366004610b56565b6107d1565b6101366101fe366004610b56565b6108c8565b610168610211366004610ae2565b610986565b6101b0610224366004610ac7565b6109b1565b604080518082018252600f81526e5f444f444f5f4c505f544f4b454e5f60881b602082015260035482516306fdde0360e01b815292516060936001600160a01b03909216916306fdde03916004808301926000929190829003018186803b15801561029357600080fd5b505afa1580156102a7573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f191682016040526102cf9190810190610b80565b816040516020016102e1929190610c3c565b60405160208183030381529060405291505090565b3360008181526006602090815260408083206001600160a01b038716808552925280832085905551919290917f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9259061034f908690610dcd565b60405180910390a35060015b92915050565b6003546001600160a01b031681565b6000546001600160a01b031681565b60045481565b6001600160a01b0383166000908152600560205260408120548211156103c65760405162461bcd60e51b81526004016103bd90610d5b565b60405180910390fd5b6001600160a01b03841660009081526006602090815260408083203384529091529020548211156104095760405162461bcd60e51b81526004016103bd90610ce3565b6001600160a01b038416600090815260056020526040902054610432908363ffffffff610a5c16565b6001600160a01b038086166000908152600560205260408082209390935590851681522054610467908363ffffffff610a8416565b6001600160a01b0380851660009081526005602090815260408083209490945591871681526006825282812033825290915220546104ab908363ffffffff610a5c16565b6001600160a01b038086166000818152600660209081526040808320338452909152908190209390935591519085169190600080516020610e2d833981519152906104f7908690610dcd565b60405180910390a35060019392505050565b6003546040805163313ce56760e01b815290516000926001600160a01b03169163313ce567916004808301926020929190829003018186803b15801561054e57600080fd5b505afa158015610562573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906105869190610c1b565b905090565b6000546001600160a01b031633146105b55760405162461bcd60e51b81526004016103bd90610d87565b6001600160a01b0382166000908152600560205260409020546105de908263ffffffff610a8416565b6001600160a01b03831660009081526005602052604090205560045461060a908263ffffffff610a8416565b6004556040516001600160a01b038316907f0f6798a560793a54c3bcfe86a93cde1e73087d944c0ea20544137d412139688590610648908490610dcd565b60405180910390a2816001600160a01b031660006001600160a01b0316600080516020610e2d833981519152836040516106829190610dcd565b60405180910390a35050565b6001546001600160a01b031633146106b85760405162461bcd60e51b81526004016103bd90610cbc565b600154600080546040516001600160a01b0393841693909116917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a360018054600080546001600160a01b03199081166001600160a01b03841617909155169055565b6001600160a01b031660009081526005602052604090205490565b6001546001600160a01b031681565b6002805460408051602060018416156101000260001901909316849004601f810184900484028201840190925281815292918301828280156107c95780601f1061079e576101008083540402835291602001916107c9565b820191906000526020600020905b8154815290600101906020018083116107ac57829003601f168201915b505050505081565b6000546001600160a01b031633146107fb5760405162461bcd60e51b81526004016103bd90610d87565b6001600160a01b038216600090815260056020526040902054610824908263ffffffff610a5c16565b6001600160a01b038316600090815260056020526040902055600454610850908263ffffffff610a5c16565b6004556040516001600160a01b038316907fcc16f5dbb4873280815c1ee09dbd06736cffcc184412cf7a71a0fdb75d397ca59061088e908490610dcd565b60405180910390a260006001600160a01b0316826001600160a01b0316600080516020610e2d833981519152836040516106829190610dcd565b336000908152600560205260408120548211156108f75760405162461bcd60e51b81526004016103bd90610d5b565b33600090815260056020526040902054610917908363ffffffff610a5c16565b33600090815260056020526040808220929092556001600160a01b03851681522054610949908363ffffffff610a8416565b6001600160a01b038416600081815260056020526040908190209290925590513390600080516020610e2d8339815191529061034f908690610dcd565b6001600160a01b03918216600090815260066020908152604080832093909416825291909152205490565b6000546001600160a01b031633146109db5760405162461bcd60e51b81526004016103bd90610d87565b6001600160a01b038116610a015760405162461bcd60e51b81526004016103bd90610d34565b600080546040516001600160a01b03808516939216917fdcf55418cee3220104fef63f979ff3c4097ad240c0c43dcb33ce837748983e6291a3600180546001600160a01b0319166001600160a01b0392909216919091179055565b600082821115610a7e5760405162461bcd60e51b81526004016103bd90610d11565b50900390565b600082820183811015610aa95760405162461bcd60e51b81526004016103bd90610daa565b9392505050565b80356001600160a01b038116811461035b57600080fd5b600060208284031215610ad8578081fd5b610aa98383610ab0565b60008060408385031215610af4578081fd5b610afe8484610ab0565b9150610b0d8460208501610ab0565b90509250929050565b600080600060608486031215610b2a578081fd5b8335610b3581610e14565b92506020840135610b4581610e14565b929592945050506040919091013590565b60008060408385031215610b68578182fd5b610b728484610ab0565b946020939093013593505050565b600060208284031215610b91578081fd5b815167ffffffffffffffff80821115610ba8578283fd5b81840185601f820112610bb9578384fd5b8051925081831115610bc9578384fd5b604051601f8401601f191681016020018381118282101715610be9578586fd5b604052838152818401602001871015610c00578485fd5b610c11846020830160208501610de4565b9695505050505050565b600060208284031215610c2c578081fd5b815160ff81168114610aa9578182fd5b60008351610c4e818460208801610de4565b8351908301610c61828260208801610de4565b01949350505050565b6001600160a01b0391909116815260200190565b901515815260200190565b6000602082528251806020840152610ca8816040850160208701610de4565b601f01601f19169190910160400192915050565b6020808252600d908201526c494e56414c49445f434c41494d60981b604082015260600190565b60208082526014908201527308298989eae829c868abe9c9ea8be8a9c9eaa8e960631b604082015260600190565b60208082526009908201526829aaa12fa2a92927a960b91b604082015260600190565b6020808252600d908201526c24a72b20a624a22fa7aba722a960991b604082015260600190565b6020808252601290820152710848298829c868abe9c9ea8be8a9c9eaa8e960731b604082015260600190565b6020808252600990820152682727aa2fa7aba722a960b91b604082015260600190565b60208082526009908201526820a2222fa2a92927a960b91b604082015260600190565b90815260200190565b60ff91909116815260200190565b60005b83811015610dff578181015183820152602001610de7565b83811115610e0e576000848401525b50505050565b6001600160a01b0381168114610e2957600080fd5b5056feddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3efa2646970667358221220841bccf74b44eca30e990eb033f46ce3d579e580f6773f839326e8d16131a6b264736f6c63430006090033
Verified Source Code Partial Match
Compiler: v0.6.9+commit.3e3065ac
EVM: istanbul
Optimization: Yes (200 runs)
DODOLpToken.sol 329 lines
// File: contracts/intf/IERC20.sol
/*
Copyright 2020 DODO ZOO.
SPDX-License-Identifier: Apache-2.0
*/
pragma solidity 0.6.9;
pragma experimental ABIEncoderV2;
/**
* @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);
function decimals() external view returns (uint8);
function name() external view returns (string memory);
/**
* @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);
}
// File: contracts/lib/SafeMath.sol
/*
Copyright 2020 DODO ZOO.
*/
/**
* @title SafeMath
* @author DODO Breeder
*
* @notice Math operations with safety checks that revert on error
*/
library SafeMath {
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
uint256 c = a * b;
require(c / a == b, "MUL_ERROR");
return c;
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
require(b > 0, "DIVIDING_ERROR");
return a / b;
}
function divCeil(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 quotient = div(a, b);
uint256 remainder = a - quotient * b;
if (remainder > 0) {
return quotient + 1;
} else {
return quotient;
}
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
require(b <= a, "SUB_ERROR");
return a - b;
}
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a, "ADD_ERROR");
return c;
}
function sqrt(uint256 x) internal pure returns (uint256 y) {
uint256 z = x / 2 + 1;
y = x;
while (z < y) {
y = z;
z = (x / z + z) / 2;
}
}
}
// File: contracts/lib/Ownable.sol
/*
Copyright 2020 DODO ZOO.
*/
/**
* @title Ownable
* @author DODO Breeder
*
* @notice Ownership related functions
*/
contract Ownable {
address public _OWNER_;
address public _NEW_OWNER_;
// ============ Events ============
event OwnershipTransferPrepared(address indexed previousOwner, address indexed newOwner);
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
// ============ Modifiers ============
modifier onlyOwner() {
require(msg.sender == _OWNER_, "NOT_OWNER");
_;
}
// ============ Functions ============
constructor() internal {
_OWNER_ = msg.sender;
emit OwnershipTransferred(address(0), _OWNER_);
}
function transferOwnership(address newOwner) external onlyOwner {
require(newOwner != address(0), "INVALID_OWNER");
emit OwnershipTransferPrepared(_OWNER_, newOwner);
_NEW_OWNER_ = newOwner;
}
function claimOwnership() external {
require(msg.sender == _NEW_OWNER_, "INVALID_CLAIM");
emit OwnershipTransferred(_OWNER_, _NEW_OWNER_);
_OWNER_ = _NEW_OWNER_;
_NEW_OWNER_ = address(0);
}
}
// File: contracts/impl/DODOLpToken.sol
/*
Copyright 2020 DODO ZOO.
*/
/**
* @title DODOLpToken
* @author DODO Breeder
*
* @notice Tokenize liquidity pool assets. An ordinary ERC20 contract with mint and burn functions
*/
contract DODOLpToken is Ownable {
using SafeMath for uint256;
string public symbol = "DLP";
address public originToken;
uint256 public totalSupply;
mapping(address => uint256) internal balances;
mapping(address => mapping(address => uint256)) internal allowed;
// ============ Events ============
event Transfer(address indexed from, address indexed to, uint256 amount);
event Approval(address indexed owner, address indexed spender, uint256 amount);
event Mint(address indexed user, uint256 value);
event Burn(address indexed user, uint256 value);
// ============ Functions ============
constructor(address _originToken) public {
originToken = _originToken;
}
function name() public view returns (string memory) {
string memory lpTokenSuffix = "_DODO_LP_TOKEN_";
return string(abi.encodePacked(IERC20(originToken).name(), lpTokenSuffix));
}
function decimals() public view returns (uint8) {
return IERC20(originToken).decimals();
}
/**
* @dev transfer token for a specified address
* @param to The address to transfer to.
* @param amount The amount to be transferred.
*/
function transfer(address to, uint256 amount) public returns (bool) {
require(amount <= balances[msg.sender], "BALANCE_NOT_ENOUGH");
balances[msg.sender] = balances[msg.sender].sub(amount);
balances[to] = balances[to].add(amount);
emit Transfer(msg.sender, to, amount);
return true;
}
/**
* @dev Gets the balance of the specified address.
* @param owner The address to query the the balance of.
* @return balance An uint256 representing the amount owned by the passed address.
*/
function balanceOf(address owner) external view returns (uint256 balance) {
return balances[owner];
}
/**
* @dev Transfer tokens from one address to another
* @param from address The address which you want to send tokens from
* @param to address The address which you want to transfer to
* @param amount uint256 the amount of tokens to be transferred
*/
function transferFrom(
address from,
address to,
uint256 amount
) public returns (bool) {
require(amount <= balances[from], "BALANCE_NOT_ENOUGH");
require(amount <= allowed[from][msg.sender], "ALLOWANCE_NOT_ENOUGH");
balances[from] = balances[from].sub(amount);
balances[to] = balances[to].add(amount);
allowed[from][msg.sender] = allowed[from][msg.sender].sub(amount);
emit Transfer(from, to, amount);
return true;
}
/**
* @dev Approve the passed address to spend the specified amount of tokens on behalf of msg.sender.
* @param spender The address which will spend the funds.
* @param amount The amount of tokens to be spent.
*/
function approve(address spender, uint256 amount) public returns (bool) {
allowed[msg.sender][spender] = amount;
emit Approval(msg.sender, spender, amount);
return true;
}
/**
* @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];
}
function mint(address user, uint256 value) external onlyOwner {
balances[user] = balances[user].add(value);
totalSupply = totalSupply.add(value);
emit Mint(user, value);
emit Transfer(address(0), user, value);
}
function burn(address user, uint256 value) external onlyOwner {
balances[user] = balances[user].sub(value);
totalSupply = totalSupply.sub(value);
emit Burn(user, value);
emit Transfer(user, address(0), value);
}
}
Read Contract
_NEW_OWNER_ 0x8456db15 → address
_OWNER_ 0x16048bc4 → address
allowance 0xdd62ed3e → uint256
balanceOf 0x70a08231 → uint256
decimals 0x313ce567 → uint8
name 0x06fdde03 → string
originToken 0x13096a41 → address
symbol 0x95d89b41 → string
totalSupply 0x18160ddd → uint256
Write Contract 7 functions
These functions modify contract state and require a wallet transaction to execute.
approve 0x095ea7b3
address spender
uint256 amount
returns: bool
burn 0x9dc29fac
address user
uint256 value
claimOwnership 0x4e71e0c8
No parameters
mint 0x40c10f19
address user
uint256 value
transfer 0xa9059cbb
address to
uint256 amount
returns: bool
transferFrom 0x23b872dd
address from
address to
uint256 amount
returns: bool
transferOwnership 0xf2fde38b
address newOwner
Recent Transactions
No transactions found for this address