Address Contract Partially Verified
Address
0x95DA1E3eECaE3771ACb05C145A131Dca45C67FD4
Balance
0 ETH
Nonce
1
Code Size
3611 bytes
Creator
0x29Ea425d...2Bc1 at tx 0xc2e42e62...0079f7
Indexed Transactions
0 (1 on-chain, 0% indexed)
Contract Bytecode
3611 bytes
0x608060405234801561001057600080fd5b506004361061010b5760003560e01c806370a08231116100a257806395d89b411161007157806395d89b41146102cd578063a48daa4f146102d5578063a9059cbb146102fe578063dd62ed3e1461032a578063f2fde38b146103585761010b565b806370a082311461026f578063715018a6146102955780638da5cb5b1461029f5780638e88de11146102a75761010b565b806323b872dd116100de57806323b872dd146101ef578063313ce567146102255780633a98ef39146102435780635d45d09d1461024b5761010b565b80630552803e1461011057806306fdde031461012a578063095ea7b3146101a757806318160ddd146101e7575b600080fd5b61011861037e565b60408051918252519081900360200190f35b610132610384565b6040805160208082528351818301528351919283929083019185019080838360005b8381101561016c578181015183820152602001610154565b50505050905090810190601f1680156101995780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6101d3600480360360408110156101bd57600080fd5b506001600160a01b038135169060200135610419565b604080519115158252519081900360200190f35b610118610498565b6101d36004803603606081101561020557600080fd5b506001600160a01b038135811691602081013590911690604001356104b6565b61022d6105cb565b6040805160ff9092168252519081900360200190f35b6101186105d4565b6102536105da565b604080516001600160a01b039092168252519081900360200190f35b6101186004803603602081101561028557600080fd5b50356001600160a01b03166105ee565b61029d610616565b005b6102536106ca565b61029d600480360360208110156102bd57600080fd5b50356001600160a01b03166106d9565b6101326107ef565b610118600480360360608110156102eb57600080fd5b508035906020810135906040013561084d565b6101d36004803603604081101561031457600080fd5b506001600160a01b038135169060200135610910565b6101186004803603604081101561034057600080fd5b506001600160a01b03813581169160200135166109d0565b61029d6004803603602081101561036e57600080fd5b50356001600160a01b0316610a0e565b60045490565b60018054604080516020601f6002600019610100878916150201909516949094049384018190048102820181019092528281526060939092909183018282801561040f5780601f106103e45761010080835404028352916020019161040f565b820191906000526020600020905b8154815290600101906020018083116103f257829003601f168201915b5050505050905090565b600061043060045483610b7190919063ffffffff16565b3360008181526007602090815260408083206001600160a01b03891680855290835292819020949094558351868152935191937f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925929081900390910190a35060015b92915050565b60006104b1600454600554610b1890919063ffffffff16565b905090565b6000806104ce60045484610b7190919063ffffffff16565b6001600160a01b03861660009081526007602090815260408083203384529091529020549091506104ff9082610bb3565b6001600160a01b03861660008181526007602090815260408083203384528252808320949094559181526006909152205461053a9082610bb3565b6001600160a01b0380871660009081526006602052604080822093909355908616815220546105699082610bf5565b6001600160a01b0380861660008181526006602090815260409182902094909455805187815290519193928916927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef92918290030190a3506001949350505050565b60035460ff1690565b60055490565b60035461010090046001600160a01b031690565b6004546001600160a01b03821660009081526006602052604081205490916104929190610b18565b61061e610c4f565b6000546001600160a01b03908116911614610680576040805162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015290519081900360640190fd5b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000546001600160a01b031690565b6106e1610c4f565b6000546001600160a01b03908116911614610743576040805162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015290519081900360640190fd5b6001600160a01b0381166107885760405162461bcd60e51b8152600401808060200182810382526027815260200180610dbf6027913960400191505060405180910390fd5b6003546040516001600160a01b0380841692610100900416907f7b8be1078fc15fa9c531c3600c578a2ce6df5480eb02b7e5ef04e0898091bcea90600090a3600380546001600160a01b0390921661010002610100600160a81b0319909216919091179055565b60028054604080516020601f600019610100600187161502019094168590049384018190048102820181019092528281526060939092909183018282801561040f5780601f106103e45761010080835404028352916020019161040f565b60035460009061010090046001600160a01b0316331461089e5760405162461bcd60e51b8152600401808060200182810382526028815260200180610d976028913960400191505060405180910390fd5b60006108bf836108b986600454610b1890919063ffffffff16565b90610b71565b9050847fc6642d24d84e7f3d36ca39f5cce10e75639d9b158d5193aa350e2f900653e4c060045483604051808381526020018281526020019250505060405180910390a26004819055949350505050565b60008061092860045484610b7190919063ffffffff16565b336000908152600660205260409020549091506109459082610bb3565b33600090815260066020526040808220929092556001600160a01b038616815220546109719082610bf5565b6001600160a01b0385166000818152600660209081526040918290209390935580518681529051919233927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9281900390910190a35060019392505050565b6004546001600160a01b0380841660009081526007602090815260408083209386168352929052908120549091610a079190610b18565b9392505050565b610a16610c4f565b6000546001600160a01b03908116911614610a78576040805162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015290519081900360640190fd5b6001600160a01b038116610abd5760405162461bcd60e51b8152600401808060200182810382526026815260200180610d506026913960400191505060405180910390fd5b600080546040516001600160a01b03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080546001600160a01b0319166001600160a01b0392909216919091179055565b600082610b2757506000610492565b82820282848281610b3457fe5b0414610a075760405162461bcd60e51b8152600401808060200182810382526021815260200180610d766021913960400191505060405180910390fd5b6000610a0783836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250610c53565b6000610a0783836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250610cf5565b600082820183811015610a07576040805162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015290519081900360640190fd5b3390565b60008183610cdf5760405162461bcd60e51b81526004018080602001828103825283818151815260200191508051906020019080838360005b83811015610ca4578181015183820152602001610c8c565b50505050905090810190601f168015610cd15780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b506000838581610ceb57fe5b0495945050505050565b60008184841115610d475760405162461bcd60e51b8152602060048201818152835160248401528351909283926044909101919085019080838360008315610ca4578181015183820152602001610c8c565b50505090039056fe4f776e61626c653a206e6577206f776e657220697320746865207a65726f2061646472657373536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f775265626173653a2063616c6c6572206973206e6f74207468652072656261736520696e766f6b65725265626173653a206e657720696e766f6b657220697320746865207a65726f2061646472657373a264697066735822122035569cd3dff4a97c454f071d0198e48941095586788d3997803010d53c83f32b64736f6c634300060c0033
Verified Source Code Partial Match
Compiler: v0.6.12+commit.27d51765
EVM: istanbul
Optimization: Yes (200 runs)
Token.sol 406 lines
// SPDX-License-Identifier: MIT
pragma solidity >=0.4.22 <0.8.0;
// File: @openzeppelin/contracts/math/SafeMath.sol
/**
* @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, 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) {
return sub(a, b, "SafeMath: subtraction overflow");
}
/**
* @dev Returns the subtraction of two unsigned integers, reverting with custom message on
* overflow (when the result is negative).
*
* 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);
uint256 c = a - b;
return c;
}
/**
* @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) {
// 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 0;
}
uint256 c = a * b;
require(c / a == b, "SafeMath: multiplication overflow");
return c;
}
/**
* @dev Returns the integer division of two unsigned integers. Reverts 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) {
return div(a, b, "SafeMath: division by zero");
}
/**
* @dev Returns the integer division of two unsigned integers. Reverts with custom message on
* division by zero. The result is rounded towards zero.
*
* Counterpart to Solidity's `/` operator. Note: this function uses a
* `revert` opcode (which leaves remaining gas untouched) while Solidity
* uses an invalid opcode to revert (consuming all remaining gas).
*
* Requirements:
*
* - The divisor cannot be zero.
*/
function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b > 0, errorMessage);
uint256 c = a / b;
// assert(a == b * c + a % b); // There is no case in which this doesn't hold
return c;
}
/**
* @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),
* Reverts when dividing by zero.
*
* Counterpart to Solidity's `%` operator. This function uses a `revert`
* opcode (which leaves remaining gas untouched) while Solidity uses an
* invalid opcode to revert (consuming all remaining gas).
*
* Requirements:
*
* - The divisor cannot be zero.
*/
function mod(uint256 a, uint256 b) internal pure returns (uint256) {
return mod(a, b, "SafeMath: modulo by zero");
}
/**
* @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),
* Reverts with custom message 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, string memory errorMessage) internal pure returns (uint256) {
require(b != 0, errorMessage);
return a % b;
}
}
// File: @openzeppelin/contracts/GSN/Context.sol
/*
* @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/access/Ownable.sol
/**
* @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.
*/
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 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: src/Token.sol
contract Token is Ownable {
using SafeMath for uint256;
string private _name;
string private _symbol;
uint8 private _decimals;
address private _rebaseInvoker;
uint256 private _perShareAmount;
uint256 private _totalShares;
mapping(address => uint256) private _shares;
mapping(address => mapping(address => uint256)) private _allowedShares;
modifier onlyRebaseInvoker() {
require(
msg.sender == _rebaseInvoker,
"Rebase: caller is not the rebase invoker"
);
_;
}
constructor() public {
_perShareAmount = 10**9;
_totalShares = 10000000 * 10**9;
_name = "Elastic";
_symbol = "ESC";
_decimals = 18;
address msgSender = _msgSender();
_shares[msgSender] = _totalShares;
emit Transfer(address(0), msgSender, _totalShares.mul(_perShareAmount));
}
function name() public view returns (string memory) {
return _name;
}
function symbol() public view returns (string memory) {
return _symbol;
}
function decimals() public view returns (uint8) {
return _decimals;
}
function totalSupply() external view returns (uint256) {
return _totalShares.mul(_perShareAmount);
}
function balanceOf(address account) external view returns (uint256) {
return _shares[account].mul(_perShareAmount);
}
function transfer(address recipient, uint256 amount)
external
returns (bool)
{
uint256 share = amount.div(_perShareAmount);
_shares[msg.sender] = _shares[msg.sender].sub(share);
_shares[recipient] = _shares[recipient].add(share);
emit Transfer(msg.sender, recipient, amount);
return true;
}
function allowance(address owner, address spender)
external
view
returns (uint256)
{
return _allowedShares[owner][spender].mul(_perShareAmount);
}
function approve(address spender, uint256 amount) external returns (bool) {
_allowedShares[msg.sender][spender] = amount.div(_perShareAmount);
emit Approval(msg.sender, spender, amount);
return true;
}
function transferFrom(
address sender,
address recipient,
uint256 amount
) external returns (bool) {
uint256 share = amount.div(_perShareAmount);
_allowedShares[sender][msg.sender] = _allowedShares[sender][msg.sender]
.sub(share);
_shares[sender] = _shares[sender].sub(share);
_shares[recipient] = _shares[recipient].add(share);
emit Transfer(sender, recipient, amount);
return true;
}
function rebaseInvoker() public view returns (address) {
return _rebaseInvoker;
}
function perShareAmount() public view returns (uint256) {
return _perShareAmount;
}
function totalShares() public view returns (uint256) {
return _totalShares;
}
function changeRebaseInvoker(address newInvoker) public onlyOwner {
require(
newInvoker != address(0),
"Rebase: new invoker is the zero address"
);
emit RebaseInvokerChanged(_rebaseInvoker, newInvoker);
_rebaseInvoker = newInvoker;
}
function rebase(
uint256 epoch,
uint256 numerator,
uint256 denominator
) external onlyRebaseInvoker returns (uint256) {
uint256 newPerShareAmount = _perShareAmount.mul(numerator).div(
denominator
);
emit Rebase(epoch, _perShareAmount, newPerShareAmount);
_perShareAmount = newPerShareAmount;
return _perShareAmount;
}
event Transfer(address indexed from, address indexed to, uint256 amount);
event Approval(
address indexed owner,
address indexed spender,
uint256 amount
);
event Rebase(
uint256 indexed epoch,
uint256 oldPerShareAmount,
uint256 newPerShareAmount
);
event RebaseInvokerChanged(
address indexed previousOwner,
address indexed newOwner
);
}
Read Contract
allowance 0xdd62ed3e → uint256
balanceOf 0x70a08231 → uint256
decimals 0x313ce567 → uint8
name 0x06fdde03 → string
owner 0x8da5cb5b → address
perShareAmount 0x0552803e → uint256
rebaseInvoker 0x5d45d09d → address
symbol 0x95d89b41 → string
totalShares 0x3a98ef39 → uint256
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
changeRebaseInvoker 0x8e88de11
address newInvoker
rebase 0xa48daa4f
uint256 epoch
uint256 numerator
uint256 denominator
returns: uint256
renounceOwnership 0x715018a6
No parameters
transfer 0xa9059cbb
address recipient
uint256 amount
returns: bool
transferFrom 0x23b872dd
address sender
address recipient
uint256 amount
returns: bool
transferOwnership 0xf2fde38b
address newOwner
Token Balances (1) $50.00
View Transfers →| Token | Balance | Price | Value |
|---|---|---|---|
| USDT | 50 | $1.0000 | $50.00 |
Recent Transactions
This address has 1 on-chain transactions, but only 0% of the chain is indexed. Transactions will appear as indexing progresses. View on Etherscan →