BEP-20
Overview
Max Total Supply
14.641947rBTC
Holders
40
Market
Price
$0.00 @ 0.000000 BNB
Onchain Market Cap
$0.00
Circulating Supply Market Cap
-
Other Info
Token Contract (WITH 18 Decimals)
Balance
0.000000000000000001 rBTCValue
$0.00Loading...
Loading
Loading...
Loading
Loading...
Loading
This contract may be a proxy contract. Click on More Options and select Is this a proxy? to confirm and enable the "Read as Proxy" & "Write as Proxy" tabs.
Contract Name:
iTokenDelegator
Compiler Version
v0.5.17+commit.d19bba13
Optimization Enabled:
Yes with 50000 runs
Other Settings:
default evmVersion
Contract Source Code (Solidity Standard Json-Input format)
pragma solidity 0.5.17;
import "./iElasticTokenInterface.sol";
import "./iTokenDelegate.sol";
contract iTokenDelegator is iElasticTokenInterface, iTokenDelegatorInterface {
/**
* @notice Construct a new iToken
* @param name_ ERC-20 name of this token
* @param symbol_ ERC-20 symbol of this token
* @param decimals_ ERC-20 decimal precision of this token
* @param initTotalSupply_ Initial token amount
* @param implementation_ The address of the implementation the contract delegates to
* @param becomeImplementationData The encoded args for becomeImplementation
*/
constructor(
string memory name_,
string memory symbol_,
uint8 decimals_,
uint256 initTotalSupply_,
address implementation_,
bytes memory becomeImplementationData
)
public
{
// Creator of the contract is gov during initialization
gov = msg.sender;
// First delegate gets to initialize the delegator (i.e. storage contract)
delegateTo(
implementation_,
abi.encodeWithSignature(
"initialize(string,string,uint8,address,uint256)",
name_,
symbol_,
decimals_,
msg.sender,
initTotalSupply_
)
);
// New implementations always get set via the settor (post-initialize)
_setImplementation(implementation_, false, becomeImplementationData);
}
/**
* @notice Called by the gov to update the implementation of the delegator
* @param implementation_ The address of the new implementation for delegation
* @param allowResign Flag to indicate whether to call _resignImplementation on the old implementation
* @param becomeImplementationData The encoded bytes data to be passed to _becomeImplementation
*/
function _setImplementation(address implementation_, bool allowResign, bytes memory becomeImplementationData) public {
require(msg.sender == gov, "iTokenDelegator::_setImplementation: Caller must be gov");
if (allowResign) {
delegateToImplementation(abi.encodeWithSignature("_resignImplementation()"));
}
address oldImplementation = implementation;
implementation = implementation_;
delegateToImplementation(abi.encodeWithSignature("_becomeImplementation(bytes)", becomeImplementationData));
emit NewImplementation(oldImplementation, implementation);
}
/**
* @notice Sender supplies assets into the market and receives cTokens in exchange
* @dev Accrues interest whether or not the operation succeeds, unless reverted
* @param mintAmount The amount of the underlying asset to supply
* @return uint 0=success, otherwise a failure (see ErrorReporter.sol for details)
*/
function mint(address to, uint256 mintAmount)
external
returns (bool)
{
// Shh
to;
mintAmount;
delegateAndReturn();
}
/**
* @notice Transfer `amount` tokens from `msg.sender` to `dst`
* @param dst The address of the destination account
* @param amount The number of tokens to transfer
* @return Whether or not the transfer succeeded
*/
function transfer(address dst, uint256 amount)
external
returns (bool)
{
// Shh
dst;
amount;
delegateAndReturn();
}
/**
* @notice Transfer `amount` tokens from `src` to `dst`
* @param src The address of the source account
* @param dst The address of the destination account
* @param amount The number of tokens to transfer
* @return Whether or not the transfer succeeded
*/
function transferFrom(
address src,
address dst,
uint256 amount
)
external
returns (bool)
{
// Shh
src;
dst;
amount;
delegateAndReturn();
}
/**
* @notice burn `amount` tokens from `msg.sender`
* @param amount The number of tokens to burn
* @return Whether or not the transfer succeeded
*/
function burn(uint256 amount)
external
returns (bool)
{
// Shh
amount;
delegateAndReturn();
}
/**
* @notice burnFrom `amount` tokens from `src`
* @param src The address of the source account
* @param amount The number of tokens to burn
* @return Whether or not the transfer succeeded
*/
function burnFrom(address src, uint256 amount)
external
returns (bool)
{
// Shh
src;
amount;
delegateAndReturn();
}
/**
* @notice Approve `spender` to transfer up to `amount` from `src`
* @dev This will overwrite the approval amount for `spender`
* and is subject to issues noted [here](https://eips.ethereum.org/EIPS/eip-20#approve)
* @param spender The address of the account which may transfer tokens
* @param amount The number of tokens that are approved (-1 means infinite)
* @return Whether or not the approval succeeded
*/
function approve(
address spender,
uint256 amount
)
external
returns (bool)
{
// Shh
spender;
amount;
delegateAndReturn();
}
/**
* @dev Increase the amount of tokens that an owner has allowed to a spender.
* This method should be used instead of approve() to avoid the double approval vulnerability
* described above.
* @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
)
external
returns (bool)
{
// Shh
spender;
addedValue;
delegateAndReturn();
}
function maxScalingFactor()
external
view
returns (uint256)
{
delegateToViewAndReturn();
}
function rebase(
uint256 epoch,
uint256 indexDelta,
bool positive
)
external
returns (uint256)
{
epoch;
indexDelta;
positive;
delegateAndReturn();
}
/**
* @dev Decrease the amount of tokens that an owner has allowed to a spender.
*
* @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
)
external
returns (bool)
{
// Shh
spender;
subtractedValue;
delegateAndReturn();
}
// --- Approve by signature ---
function permit(
address owner,
address spender,
uint256 value,
uint256 deadline,
uint8 v,
bytes32 r,
bytes32 s
)
external
{
// Shh
owner;
spender;
value;
deadline;
v;
r;
s;
delegateAndReturn();
}
/**
* @notice Get the current allowance from `owner` for `spender`
* @param owner The address of the account which owns the tokens to be spent
* @param spender The address of the account which may transfer tokens
* @return The number of tokens allowed to be spent (-1 means infinite)
*/
function allowance(
address owner,
address spender
)
external
view
returns (uint256)
{
// Shh
owner;
spender;
delegateToViewAndReturn();
}
/**
* @notice Rescues tokens and sends them to the `to` address
* @param token The address of the token
* @param to The address for which the tokens should be send
* @return Success
*/
function rescueTokens(
address token,
address to,
uint256 amount
)
external
returns (bool)
{
// Shh
token;
to;
amount;
delegateAndReturn();
}
/**
* @notice Get the current allowance from `owner` for `spender`
* @param delegator The address of the account which has designated a delegate
* @return Address of delegatee
*/
function delegates(
address delegator
)
external
view
returns (address)
{
// Shh
delegator;
delegateToViewAndReturn();
}
/**
* @notice Get the token balance of the `owner`
* @param owner The address of the account to query
* @return The number of tokens owned by `owner`
*/
function balanceOf(address owner)
external
view
returns (uint256)
{
// Shh
owner;
delegateToViewAndReturn();
}
/**
* @notice Currently unused. For future compatability
* @param owner The address of the account to query
* @return The number of underlying tokens owned by `owner`
*/
function balanceOfUnderlying(address owner)
external
view
returns (uint256)
{
// Shh
owner;
delegateToViewAndReturn();
}
/*** Gov Functions ***/
/**
* @notice Begins transfer of gov rights. The newPendingGov must call `_acceptGov` to finalize the transfer.
* @dev Gov function to begin change of gov. The newPendingGov must call `_acceptGov` to finalize the transfer.
* @param newPendingGov New pending gov.
*/
function _setPendingGov(address newPendingGov)
external
{
// Shh
newPendingGov;
delegateAndReturn();
}
function _setRebaser(address rebaser_)
external
{
// Shh
rebaser_;
delegateAndReturn();
}
function _setBanker(address banker_)
external
{
// Shh
banker_;
delegateAndReturn();
}
function _setIncentivizer(address incentivizer_)
external
{
// Shh
incentivizer_;
delegateAndReturn();
}
/**
* @notice Accepts transfer of gov rights. msg.sender must be pendingGov
* @dev Gov function for pending gov to accept role and update gov
* @return uint 0=success, otherwise a failure (see ErrorReporter.sol for details)
*/
function _acceptGov()
external
{
delegateAndReturn();
}
function getPriorVotes(address account, uint blockNumber)
external
view
returns (uint256)
{
account;
blockNumber;
delegateToViewAndReturn();
}
function delegateBySig(
address delegatee,
uint nonce,
uint expiry,
uint8 v,
bytes32 r,
bytes32 s
)
external
{
delegatee;
nonce;
expiry;
v;
r;
s;
delegateAndReturn();
}
function delegate(address delegatee)
external
{
delegatee;
delegateAndReturn();
}
function getCurrentVotes(address account) external view returns (uint256)
{
account;
delegateToViewAndReturn();
}
function itokenToFragment(uint256 itoken)
external
view
returns (uint256)
{
itoken;
delegateToViewAndReturn();
}
function fragmentToiToken(uint256 value)
external
view
returns (uint256)
{
value;
delegateToViewAndReturn();
}
/**
* @notice Internal method to delegate execution to another contract
* @dev It returns to the external caller whatever the implementation returns or forwards reverts
* @param callee The contract to delegatecall
* @param data The raw data to delegatecall
* @return The returned bytes from the delegatecall
*/
function delegateTo(address callee, bytes memory data) internal returns (bytes memory) {
(bool success, bytes memory returnData) = callee.delegatecall(data);
assembly {
if eq(success, 0) {
revert(add(returnData, 0x20), returndatasize)
}
}
return returnData;
}
/**
* @notice Delegates execution to the implementation contract
* @dev It returns to the external caller whatever the implementation returns or forwards reverts
* @param data The raw data to delegatecall
* @return The returned bytes from the delegatecall
*/
function delegateToImplementation(bytes memory data) public returns (bytes memory) {
return delegateTo(implementation, data);
}
/**
* @notice Delegates execution to an implementation contract
* @dev It returns to the external caller whatever the implementation returns or forwards reverts
* There are an additional 2 prefix uints from the wrapper returndata, which we ignore since we make an extra hop.
* @param data The raw data to delegatecall
* @return The returned bytes from the delegatecall
*/
function delegateToViewImplementation(bytes memory data) public view returns (bytes memory) {
(bool success, bytes memory returnData) = address(this).staticcall(abi.encodeWithSignature("delegateToImplementation(bytes)", data));
assembly {
if eq(success, 0) {
revert(add(returnData, 0x20), returndatasize)
}
}
return abi.decode(returnData, (bytes));
}
function delegateToViewAndReturn() private view returns (bytes memory) {
(bool success,) = address(this).staticcall(abi.encodeWithSignature("delegateToImplementation(bytes)", msg.data));
assembly {
let free_mem_ptr := mload(0x40)
returndatacopy(free_mem_ptr, 0, returndatasize)
switch success
case 0 {revert(free_mem_ptr, returndatasize)}
default {return (add(free_mem_ptr, 0x40), sub(returndatasize, 0x40))}
}
}
function delegateAndReturn() private returns (bytes memory) {
(bool success,) = implementation.delegatecall(msg.data);
assembly {
let free_mem_ptr := mload(0x40)
returndatacopy(free_mem_ptr, 0, returndatasize)
switch success
case 0 {revert(free_mem_ptr, returndatasize)}
default {return (free_mem_ptr, returndatasize)}
}
}
/**
* @notice Delegates execution to an implementation contract
* @dev It returns to the external caller whatever the implementation returns or forwards reverts
*/
function() external payable {
require(msg.value == 0, "iTokenDelegator:fallback: cannot send value to fallback");
// delegate all other functions to current implementation
delegateAndReturn();
}
}pragma solidity 0.5.17;
import "./iElasticTokenStorage.sol";
import "./iTokenGovernanceStorage.sol";
contract iElasticTokenInterface is iElasticTokenStorage, iTokenGovernanceStorage {
/// @notice An event thats emitted when an account changes its delegate
event DelegateChanged(address indexed delegator, address indexed fromDelegate, address indexed toDelegate);
/// @notice An event thats emitted when a delegate account's vote balance changes
event DelegateVotesChanged(address indexed delegate, uint previousBalance, uint newBalance);
/**
* @notice Event emitted when tokens are rebased
*/
event Rebase(uint256 epoch, uint256 previTokensScalingFactor, uint256 newiTokensScalingFactor);
/*** Gov Events ***/
/**
* @notice Event emitted when pendingGov is changed
*/
event NewPendingGov(address oldPendingGov, address newPendingGov);
/**
* @notice Event emitted when gov is changed
*/
event NewGov(address oldGov, address newGov);
/**
* @notice Sets the rebaser contract
*/
event NewRebaser(address oldRebaser, address newRebaser);
/**
* @notice Sets the incentivizer contract
*/
event NewIncentivizer(address oldIncentivizer, address newIncentivizer);
/**
* @notice Sets the IFABank contract
*/
event NewBanker(address oldBanker, address newBanker);
/* - ERC20 Events - */
/**
* @notice EIP20 Transfer event
*/
event Transfer(address indexed from, address indexed to, uint amount);
/**
* @notice EIP20 Approval event
*/
event Approval(address indexed owner, address indexed spender, uint amount);
/* - Extra Events - */
/**
* @notice Tokens minted event
*/
event Mint(address to, uint256 amount);
event Burn(address from, uint256 amount);
// Public functions
function burn(uint256 amount) external returns (bool);
function transfer(address to, uint256 value) external returns (bool);
function transferFrom(address from, address to, uint256 value) external returns (bool);
function balanceOf(address who) external view returns (uint256);
function balanceOfUnderlying(address who) external view returns (uint256);
function allowance(address owner_, address spender) external view returns (uint256);
function approve(address spender, uint256 value) external returns (bool);
function increaseAllowance(address spender, uint256 addedValue) external returns (bool);
function decreaseAllowance(address spender, uint256 subtractedValue) external returns (bool);
function maxScalingFactor() external view returns (uint256);
function itokenToFragment(uint256 itoken) external view returns (uint256);
function fragmentToiToken(uint256 value) external view returns (uint256);
/* - Governance Functions - */
function getPriorVotes(address account, uint blockNumber) external view returns (uint256);
function delegateBySig(address delegatee, uint nonce, uint expiry, uint8 v, bytes32 r, bytes32 s) external;
function delegate(address delegatee) external;
function delegates(address delegator) external view returns (address);
function getCurrentVotes(address account) external view returns (uint256);
/* - Permissioned/Governance functions - */
function mint(address to, uint256 amount) external returns (bool);
function burnFrom(address account, uint256 amount) external returns (bool);
function rebase(uint256 epoch, uint256 indexDelta, bool positive) external returns (uint256);
function _setRebaser(address rebaser_) external;
function _setIncentivizer(address incentivizer_) external;
function _setBanker(address banker_) external;
function _setPendingGov(address pendingGov_) external;
function _acceptGov() external;
}pragma solidity 0.5.17;
import "../lib/SafeMath.sol";
// Storage for a iToken
contract iElasticTokenStorage {
using SafeMath for uint256;
/**
* @dev Guard variable for re-entrancy checks. Not currently used
*/
bool internal _notEntered;
/**
* @notice EIP-20 token name for this token
*/
string public name;
/**
* @notice EIP-20 token symbol for this token
*/
string public symbol;
/**
* @notice EIP-20 token decimals for this token
*/
uint8 public decimals;
/**
* @notice Governor for this contract
*/
address public gov;
/**
* @notice Pending governance for this contract
*/
address public pendingGov;
/**
* @notice Approved rebaser for this contract
*/
address public rebaser;
/**
* @notice Reserve address of iToken protocol
*/
address public incentivizer;
/**
* @notice IFABank address of ifarm protocol
*/
address public banker;
/**
* @notice Total supply of iTokens
*/
uint256 public totalSupply;
/**
* @notice Internal decimals used to handle scaling factor
*/
uint256 public constant internalDecimals = 10 ** 24;
/**
* @notice Used for percentage maths
*/
uint256 public constant BASE = 10 ** 18;
/**
* @notice Scaling factor that adjusts everyone's balances
*/
uint256 public itokensScalingFactor;
mapping(address => uint256) internal _itokenBalances;
mapping(address => mapping(address => uint256)) internal _allowedFragments;
uint256 public initSupply;
// keccak256("Permit(address owner,address spender,uint256 value,uint256 nonce,uint256 deadline)");
bytes32 public constant PERMIT_TYPEHASH = 0x6e71edae12b1b97f4d1f60370fef10105fa2faae0126114a169c64845d6126c9;
bytes32 public DOMAIN_SEPARATOR;
}pragma solidity 0.5.17;
/* import "./iElasticTokenInterface.sol"; */
import "./iTokenGovernance.sol";
import "../lib/SafeERC20.sol";
contract iElasticToken is iTokenGovernanceToken {
// Modifiers
modifier onlyGov() {
require(msg.sender == gov);
_;
}
modifier onlyRebaser() {
require(msg.sender == rebaser);
_;
}
modifier onlyBanker() {
require(msg.sender == banker);
_;
}
modifier onlyMinter() {
require(msg.sender == rebaser
|| msg.sender == incentivizer
|| msg.sender == gov
|| msg.sender == banker, "not minter");
_;
}
modifier validRecipient(address to) {
require(to != address(0x0));
require(to != address(this));
_;
}
function initialize(
string memory name_,
string memory symbol_,
uint8 decimals_
)
public
{
require(itokensScalingFactor == 0, "already initialized");
name = name_;
symbol = symbol_;
decimals = decimals_;
}
/**
* @notice Computes the current max scaling factor
*/
function maxScalingFactor()
external
view
returns (uint256)
{
return _maxScalingFactor();
}
function _maxScalingFactor()
internal
view
returns (uint256)
{
// scaling factor can only go up to 2**256-1 = initSupply * itokensScalingFactor
// this is used to check if itokensScalingFactor will be too high to compute balances when rebasing.
return uint256(- 1) / initSupply;
}
/**
* @notice Mints new tokens, increasing totalSupply, initSupply, and a users balance.
* @dev Limited to onlyMinter modifier
*/
function mint(address to, uint256 amount)
external
onlyMinter
returns (bool)
{
_mint(to, amount);
return true;
}
function _mint(address to, uint256 amount)
internal
{
// increase totalSupply
totalSupply = totalSupply.add(amount);
// get underlying value
uint256 itokenValue = _fragmentToiToken(amount);
// increase initSupply
initSupply = initSupply.add(itokenValue);
// make sure the mint didnt push maxScalingFactor too low
require(itokensScalingFactor <= _maxScalingFactor(), "max scaling factor too low");
// add balance
_itokenBalances[to] = _itokenBalances[to].add(itokenValue);
// add delegates to the minter
_moveDelegates(address(0), _delegates[to], itokenValue);
emit Mint(to, amount);
emit Transfer(address(0), to, amount);
}
function burn(uint256 amount) external returns (bool) {
_burn(msg.sender, amount);
return true;
}
/// @notice Burns `_amount` token in `account`. Must only be called by the IFABank.
function burnFrom(address account, uint256 amount) external onlyBanker returns (bool) {
// decreased Allowance
uint256 allowance = _allowedFragments[account][msg.sender];
uint256 decreasedAllowance = allowance.sub(amount);
// approve
_allowedFragments[account][msg.sender] = decreasedAllowance;
emit Approval(account, msg.sender, decreasedAllowance);
// burn
_burn(account, amount);
return true;
}
function _burn(address account, uint256 amount) internal {
require(account != address(0), "ERC20: burn from the zero address");
// get underlying value
uint256 itokenValue = _fragmentToiToken(amount);
// sub balance
_itokenBalances[account] = _itokenBalances[account].sub(itokenValue);
// decrease initSupply
initSupply = initSupply.sub(itokenValue);
// decrease totalSupply
totalSupply = totalSupply.sub(amount);
//remove delegates from the account
_moveDelegates(_delegates[account], address(0), itokenValue);
emit Burn(account, amount);
emit Transfer(account, address(0), amount);
}
/* - ERC20 functionality - */
/**
* @dev Transfer tokens to a specified address.
* @param to The address to transfer to.
* @param value The amount to be transferred.
* @return True on success, false otherwise.
*/
function transfer(address to, uint256 value)
external
validRecipient(to)
returns (bool)
{
// underlying balance is stored in itokens, so divide by current scaling factor
// note, this means as scaling factor grows, dust will be untransferrable.
// minimum transfer value == itokensScalingFactor / 1e24;
// get amount in underlying
uint256 itokenValue = _fragmentToiToken(value);
// sub from balance of sender
_itokenBalances[msg.sender] = _itokenBalances[msg.sender].sub(itokenValue);
// add to balance of receiver
_itokenBalances[to] = _itokenBalances[to].add(itokenValue);
emit Transfer(msg.sender, to, value);
_moveDelegates(_delegates[msg.sender], _delegates[to], itokenValue);
return true;
}
/**
* @dev Transfer tokens from one address to another.
* @param from The address you want to send tokens from.
* @param to The address you want to transfer to.
* @param value The amount of tokens to be transferred.
*/
function transferFrom(address from, address to, uint256 value)
external
validRecipient(to)
returns (bool)
{
// decrease allowance
_allowedFragments[from][msg.sender] = _allowedFragments[from][msg.sender].sub(value);
// get value in itokens
uint256 itokenValue = _fragmentToiToken(value);
// sub from from
_itokenBalances[from] = _itokenBalances[from].sub(itokenValue);
_itokenBalances[to] = _itokenBalances[to].add(itokenValue);
emit Transfer(from, to, value);
_moveDelegates(_delegates[from], _delegates[to], itokenValue);
return true;
}
/**
* @param who The address to query.
* @return The balance of the specified address.
*/
function balanceOf(address who)
external
view
returns (uint256)
{
return _itokenToFragment(_itokenBalances[who]);
}
/** @notice Currently returns the internal storage amount
* @param who The address to query.
* @return The underlying balance of the specified address.
*/
function balanceOfUnderlying(address who)
external
view
returns (uint256)
{
return _itokenBalances[who];
}
/**
* @dev Function to check the amount of tokens that an owner has allowed to a spender.
* @param owner_ The address which owns the funds.
* @param spender The address which will spend the funds.
* @return The number of tokens still available for the spender.
*/
function allowance(address owner_, address spender)
external
view
returns (uint256)
{
return _allowedFragments[owner_][spender];
}
/**
* @dev Approve the passed address to spend the specified amount of tokens on behalf of
* msg.sender. This method is included for ERC20 compatibility.
* increaseAllowance and decreaseAllowance should be used instead.
* Changing an allowance with this method brings the risk that someone may transfer both
* the old and the new allowance - if they are both greater than zero - if a transfer
* transaction is mined before the later approve() call is mined.
*
* @param spender The address which will spend the funds.
* @param value The amount of tokens to be spent.
*/
function approve(address spender, uint256 value)
external
returns (bool)
{
_allowedFragments[msg.sender][spender] = value;
emit Approval(msg.sender, spender, value);
return true;
}
/**
* @dev Increase the amount of tokens that an owner has allowed to a spender.
* This method should be used instead of approve() to avoid the double approval vulnerability
* described above.
* @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)
external
returns (bool)
{
_allowedFragments[msg.sender][spender] =
_allowedFragments[msg.sender][spender].add(addedValue);
emit Approval(msg.sender, spender, _allowedFragments[msg.sender][spender]);
return true;
}
/**
* @dev Decrease the amount of tokens that an owner has allowed to a spender.
*
* @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)
external
returns (bool)
{
uint256 oldValue = _allowedFragments[msg.sender][spender];
if (subtractedValue >= oldValue) {
_allowedFragments[msg.sender][spender] = 0;
} else {
_allowedFragments[msg.sender][spender] = oldValue.sub(subtractedValue);
}
emit Approval(msg.sender, spender, _allowedFragments[msg.sender][spender]);
return true;
}
// --- Approve by signature ---
function permit(
address owner,
address spender,
uint256 value,
uint256 deadline,
uint8 v,
bytes32 r,
bytes32 s
)
external
{
require(now <= deadline, "iToken/permit-expired");
bytes32 digest =
keccak256(
abi.encodePacked(
"\x19\x01",
DOMAIN_SEPARATOR,
keccak256(
abi.encode(
PERMIT_TYPEHASH,
owner,
spender,
value,
nonces[owner]++,
deadline
)
)
)
);
require(owner != address(0), "iToken/invalid-address-0");
require(owner == ecrecover(digest, v, r, s), "iToken/invalid-permit");
_allowedFragments[owner][spender] = value;
emit Approval(owner, spender, value);
}
/* - Governance Functions - */
/** @notice sets the rebaser
* @param rebaser_ The address of the rebaser contract to use for authentication.
*/
function _setRebaser(address rebaser_)
external
onlyGov
{
address oldRebaser = rebaser;
rebaser = rebaser_;
emit NewRebaser(oldRebaser, rebaser_);
}
/** @notice sets the incentivizer
* @param incentivizer_ The address of the rebaser contract to use for authentication.
*/
function _setIncentivizer(address incentivizer_)
external
onlyGov
{
address oldIncentivizer = incentivizer;
incentivizer = incentivizer_;
emit NewIncentivizer(oldIncentivizer, incentivizer_);
}
/** @notice sets the banker
* @param banker_ The address of the IFABank contract to use for authentication.
*/
function _setBanker(address banker_)
external
onlyGov
{
address oldBanker = banker;
banker = banker_;
emit NewBanker(oldBanker, banker_);
}
/** @notice sets the pendingGov
* @param pendingGov_ The address of the rebaser contract to use for authentication.
*/
function _setPendingGov(address pendingGov_)
external
onlyGov
{
address oldPendingGov = pendingGov;
pendingGov = pendingGov_;
emit NewPendingGov(oldPendingGov, pendingGov_);
}
/** @notice lets msg.sender accept governance
*
*/
function _acceptGov()
external
{
require(msg.sender == pendingGov, "!pending");
address oldGov = gov;
gov = pendingGov;
pendingGov = address(0);
emit NewGov(oldGov, gov);
}
/* - Extras - */
/**
* @notice Initiates a new rebase operation, provided the minimum time period has elapsed.
*
* @dev The supply adjustment equals (totalSupply * DeviationFromTargetRate) / rebaseLag
* Where DeviationFromTargetRate is (MarketOracleRate - targetRate) / targetRate
* and targetRate is CpiOracleRate / baseCpi
*/
function rebase(
uint256 epoch,
uint256 indexDelta,
bool positive
)
external
onlyRebaser
returns (uint256)
{
// no change
if (indexDelta == 0) {
emit Rebase(epoch, itokensScalingFactor, itokensScalingFactor);
return totalSupply;
}
// for events
uint256 previTokensScalingFactor = itokensScalingFactor;
if (!positive) {
// negative rebase, decrease scaling factor
itokensScalingFactor = itokensScalingFactor.mul(BASE.sub(indexDelta)).div(BASE);
} else {
// positive reabse, increase scaling factor
uint256 newScalingFactor = itokensScalingFactor.mul(BASE.add(indexDelta)).div(BASE);
if (newScalingFactor < _maxScalingFactor()) {
itokensScalingFactor = newScalingFactor;
} else {
itokensScalingFactor = _maxScalingFactor();
}
}
// update total supply, correctly
totalSupply = _itokenToFragment(initSupply);
emit Rebase(epoch, previTokensScalingFactor, itokensScalingFactor);
return totalSupply;
}
function itokenToFragment(uint256 itoken)
external
view
returns (uint256)
{
return _itokenToFragment(itoken);
}
function fragmentToiToken(uint256 value)
external
view
returns (uint256)
{
return _fragmentToiToken(value);
}
function _itokenToFragment(uint256 itoken)
internal
view
returns (uint256)
{
return itoken.mul(itokensScalingFactor).div(internalDecimals);
}
function _fragmentToiToken(uint256 value)
internal
view
returns (uint256)
{
return value.mul(internalDecimals).div(itokensScalingFactor);
}
// Rescue tokens
function rescueTokens(
address token,
address to,
uint256 amount
)
external
onlyGov
returns (bool)
{
// transfer to
SafeERC20.safeTransfer(IERC20(token), to, amount);
return true;
}
}
contract iToken is iElasticToken {
/**
* @notice Initialize the new money market
* @param name_ ERC-20 name of this token
* @param symbol_ ERC-20 symbol of this token
* @param decimals_ ERC-20 decimal precision of this token
*/
function initialize(
string memory name_,
string memory symbol_,
uint8 decimals_,
address initial_owner,
uint256 initTotalSupply_
)
public
{
super.initialize(name_, symbol_, decimals_);
itokensScalingFactor = BASE;
initSupply = _fragmentToiToken(initTotalSupply_);
totalSupply = initTotalSupply_;
_itokenBalances[initial_owner] = initSupply;
DOMAIN_SEPARATOR = keccak256(
abi.encode(
DOMAIN_TYPEHASH,
keccak256(bytes(name)),
getChainId(),
address(this)
)
);
}
}pragma solidity 0.5.17;
import "./iToken.sol";
contract iTokenDelegationStorage {
/**
* @notice Implementation address for this contract
*/
address public implementation;
}
contract iTokenDelegatorInterface is iTokenDelegationStorage {
/**
* @notice Emitted when implementation is changed
*/
event NewImplementation(address oldImplementation, address newImplementation);
/**
* @notice Called by the gov to update the implementation of the delegator
* @param implementation_ The address of the new implementation for delegation
* @param allowResign Flag to indicate whether to call _resignImplementation on the old implementation
* @param becomeImplementationData The encoded bytes data to be passed to _becomeImplementation
*/
function _setImplementation(address implementation_, bool allowResign, bytes memory becomeImplementationData) public;
}
contract iTokenDelegateInterface is iTokenDelegationStorage {
/**
* @notice Called by the delegator on a delegate to initialize it for duty
* @dev Should revert if any issues arise which make it unfit for delegation
* @param data The encoded bytes data for any initialization
*/
function _becomeImplementation(bytes memory data) public;
/**
* @notice Called by the delegator on a delegate to forfeit its responsibility
*/
function _resignImplementation() public;
}
contract iTokenDelegate is iToken, iTokenDelegateInterface {
/**
* @notice Construct an empty delegate
*/
constructor() public {}
/**
* @notice Called by the delegator on a delegate to initialize it for duty
* @param data The encoded bytes data for any initialization
*/
function _becomeImplementation(bytes memory data) public {
// Shh -- currently unused
data;
// Shh -- we don't ever want this hook to be marked pure
if (false) {
implementation = address(0);
}
require(msg.sender == gov, "only the gov may call _becomeImplementation");
}
/**
* @notice Called by the delegator on a delegate to forfeit its responsibility
*/
function _resignImplementation() public {
// Shh -- we don't ever want this hook to be marked pure
if (false) {
implementation = address(0);
}
require(msg.sender == gov, "only the gov may call _resignImplementation");
}
}pragma solidity 0.5.17;
pragma experimental ABIEncoderV2;
import "./iTokenGovernanceStorage.sol";
import "./iElasticTokenInterface.sol";
contract iTokenGovernanceToken is iElasticTokenInterface {
/// @notice An event thats emitted when an account changes its delegate
event DelegateChanged(address indexed delegator, address indexed fromDelegate, address indexed toDelegate);
/// @notice An event thats emitted when a delegate account's vote balance changes
event DelegateVotesChanged(address indexed delegate, uint previousBalance, uint newBalance);
/**
* @notice Get delegatee for an address delegating
* @param delegator The address to get delegatee for
*/
function delegates(address delegator)
external
view
returns (address)
{
return _delegates[delegator];
}
/**
* @notice Delegate votes from `msg.sender` to `delegatee`
* @param delegatee The address to delegate votes to
*/
function delegate(address delegatee) external {
return _delegate(msg.sender, delegatee);
}
/**
* @notice Delegates votes from signatory to `delegatee`
* @param delegatee The address to delegate votes to
* @param nonce The contract state required to match the signature
* @param expiry The time at which to expire the signature
* @param v The recovery byte of the signature
* @param r Half of the ECDSA signature pair
* @param s Half of the ECDSA signature pair
*/
function delegateBySig(
address delegatee,
uint nonce,
uint expiry,
uint8 v,
bytes32 r,
bytes32 s
)
external
{
bytes32 structHash = keccak256(
abi.encode(
DELEGATION_TYPEHASH,
delegatee,
nonce,
expiry
)
);
bytes32 digest = keccak256(
abi.encodePacked(
"\x19\x01",
DOMAIN_SEPARATOR,
structHash
)
);
address signatory = ecrecover(digest, v, r, s);
require(signatory != address(0), "iToken::delegateBySig: invalid signature");
require(nonce == nonces[signatory]++, "iToken::delegateBySig: invalid nonce");
require(now <= expiry, "iToken::delegateBySig: signature expired");
return _delegate(signatory, delegatee);
}
/**
* @notice Gets the current votes balance for `account`
* @param account The address to get votes balance
* @return The number of current votes for `account`
*/
function getCurrentVotes(address account)
external
view
returns (uint256)
{
uint32 nCheckpoints = numCheckpoints[account];
return nCheckpoints > 0 ? checkpoints[account][nCheckpoints - 1].votes : 0;
}
/**
* @notice Determine the prior number of votes for an account as of a block number
* @dev Block number must be a finalized block or else this function will revert to prevent misinformation.
* @param account The address of the account to check
* @param blockNumber The block number to get the vote balance at
* @return The number of votes the account had as of the given block
*/
function getPriorVotes(address account, uint blockNumber)
external
view
returns (uint256)
{
require(blockNumber < block.number, "iToken::getPriorVotes: not yet determined");
uint32 nCheckpoints = numCheckpoints[account];
if (nCheckpoints == 0) {
return 0;
}
// First check most recent balance
if (checkpoints[account][nCheckpoints - 1].fromBlock <= blockNumber) {
return checkpoints[account][nCheckpoints - 1].votes;
}
// Next check implicit zero balance
if (checkpoints[account][0].fromBlock > blockNumber) {
return 0;
}
uint32 lower = 0;
uint32 upper = nCheckpoints - 1;
while (upper > lower) {
uint32 center = upper - (upper - lower) / 2;
// ceil, avoiding overflow
Checkpoint memory cp = checkpoints[account][center];
if (cp.fromBlock == blockNumber) {
return cp.votes;
} else if (cp.fromBlock < blockNumber) {
lower = center;
} else {
upper = center - 1;
}
}
return checkpoints[account][lower].votes;
}
function _delegate(address delegator, address delegatee)
internal
{
address currentDelegate = _delegates[delegator];
uint256 delegatorBalance = _itokenBalances[delegator];
// balance of underlying iTokens (not scaled);
_delegates[delegator] = delegatee;
emit DelegateChanged(delegator, currentDelegate, delegatee);
_moveDelegates(currentDelegate, delegatee, delegatorBalance);
}
function _moveDelegates(address srcRep, address dstRep, uint256 amount) internal {
if (srcRep != dstRep && amount > 0) {
if (srcRep != address(0)) {
// decrease old representative
uint32 srcRepNum = numCheckpoints[srcRep];
uint256 srcRepOld = srcRepNum > 0 ? checkpoints[srcRep][srcRepNum - 1].votes : 0;
uint256 srcRepNew = srcRepOld.sub(amount);
_writeCheckpoint(srcRep, srcRepNum, srcRepOld, srcRepNew);
}
if (dstRep != address(0)) {
// increase new representative
uint32 dstRepNum = numCheckpoints[dstRep];
uint256 dstRepOld = dstRepNum > 0 ? checkpoints[dstRep][dstRepNum - 1].votes : 0;
uint256 dstRepNew = dstRepOld.add(amount);
_writeCheckpoint(dstRep, dstRepNum, dstRepOld, dstRepNew);
}
}
}
function _writeCheckpoint(
address delegatee,
uint32 nCheckpoints,
uint256 oldVotes,
uint256 newVotes
)
internal
{
uint32 blockNumber = safe32(block.number, "iToken::_writeCheckpoint: block number exceeds 32 bits");
if (nCheckpoints > 0 && checkpoints[delegatee][nCheckpoints - 1].fromBlock == blockNumber) {
checkpoints[delegatee][nCheckpoints - 1].votes = newVotes;
} else {
checkpoints[delegatee][nCheckpoints] = Checkpoint(blockNumber, newVotes);
numCheckpoints[delegatee] = nCheckpoints + 1;
}
emit DelegateVotesChanged(delegatee, oldVotes, newVotes);
}
function safe32(uint n, string memory errorMessage) internal pure returns (uint32) {
require(n < 2 ** 32, errorMessage);
return uint32(n);
}
function getChainId() internal pure returns (uint) {
uint256 chainId;
assembly {chainId := chainid()}
return chainId;
}
}pragma solidity 0.5.17;
pragma experimental ABIEncoderV2;
contract iTokenGovernanceStorage {
/// @notice A record of each accounts delegate
mapping(address => address) internal _delegates;
/// @notice A checkpoint for marking number of votes from a given block
struct Checkpoint {
uint32 fromBlock;
uint256 votes;
}
/// @notice A record of votes checkpoints for each account, by index
mapping(address => mapping(uint32 => Checkpoint)) public checkpoints;
/// @notice The number of checkpoints for each account
mapping(address => uint32) public numCheckpoints;
/// @notice The EIP-712 typehash for the contract's domain
bytes32 public constant DOMAIN_TYPEHASH = keccak256("EIP712Domain(string name,uint256 chainId,address verifyingContract)");
/// @notice The EIP-712 typehash for the delegation struct used by the contract
bytes32 public constant DELEGATION_TYPEHASH = keccak256("Delegation(address delegatee,uint256 nonce,uint256 expiry)");
/// @notice A record of states for signing / validating signatures
mapping(address => uint) public nonces;
}// SPDX-License-Identifier: MIT
pragma solidity ^0.5.15;
/**
* @dev Collection of functions related to the address type
*/
library Address {
/**
* @dev Returns true if `account` is a contract.
*
* [IMPORTANT]
* ====
* It is unsafe to assume that an address for which this function returns
* false is an externally-owned account (EOA) and not a contract.
*
* Among others, `isContract` will return false for the following
* types of addresses:
*
* - an externally-owned account
* - a contract in construction
* - an address where a contract will be created
* - an address where a contract lived, but was destroyed
* ====
*/
function isContract(address account) internal view returns (bool) {
// This method relies in extcodesize, which returns 0 for contracts in
// construction, since the code is only stored at the end of the
// constructor execution.
uint256 size;
// solhint-disable-next-line no-inline-assembly
assembly { size := extcodesize(account) }
return size > 0;
}
/**
* @dev Replacement for Solidity's `transfer`: sends `amount` wei to
* `recipient`, forwarding all available gas and reverting on errors.
*
* https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost
* of certain opcodes, possibly making contracts go over the 2300 gas limit
* imposed by `transfer`, making them unable to receive funds via
* `transfer`. {sendValue} removes this limitation.
*
* https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more].
*
* IMPORTANT: because control is transferred to `recipient`, care must be
* taken to not create reentrancy vulnerabilities. Consider using
* {ReentrancyGuard} or the
* https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].
*/
function sendValue(address payable recipient, uint256 amount) internal {
require(address(this).balance >= amount, "Address: insufficient balance");
// solhint-disable-next-line avoid-low-level-calls, avoid-call-value
(bool success, ) = recipient.call.value(amount)("");
require(success, "Address: unable to send value, recipient may have reverted");
}
/**
* @dev Performs a Solidity function call using a low level `call`. A
* plain`call` is an unsafe replacement for a function call: use this
* function instead.
*
* If `target` reverts with a revert reason, it is bubbled up by this
* function (like regular Solidity function calls).
*
* Returns the raw returned data. To convert to the expected return value,
* use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].
*
* Requirements:
*
* - `target` must be a contract.
* - calling `target` with `data` must not revert.
*
* _Available since v3.1._
*/
function functionCall(address target, bytes memory data) internal returns (bytes memory) {
return functionCall(target, data, "Address: low-level call failed");
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with
* `errorMessage` as a fallback revert reason when `target` reverts.
*
* _Available since v3.1._
*/
function functionCall(address target, bytes memory data, string memory errorMessage) internal returns (bytes memory) {
return _functionCallWithValue(target, data, 0, errorMessage);
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
* but also transferring `value` wei to `target`.
*
* Requirements:
*
* - the calling contract must have an ETH balance of at least `value`.
* - the called Solidity function must be `payable`.
*
* _Available since v3.1._
*/
function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) {
return functionCallWithValue(target, data, value, "Address: low-level call with value failed");
}
/**
* @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but
* with `errorMessage` as a fallback revert reason when `target` reverts.
*
* _Available since v3.1._
*/
function functionCallWithValue(address target, bytes memory data, uint256 value, string memory errorMessage) internal returns (bytes memory) {
require(address(this).balance >= value, "Address: insufficient balance for call");
return _functionCallWithValue(target, data, value, errorMessage);
}
function _functionCallWithValue(address target, bytes memory data, uint256 weiValue, string memory errorMessage) private returns (bytes memory) {
require(isContract(target), "Address: call to non-contract");
// solhint-disable-next-line avoid-low-level-calls
(bool success, bytes memory returndata) = target.call.value(weiValue)(data);
if (success) {
return returndata;
} else {
// Look for revert reason and bubble it up if present
if (returndata.length > 0) {
// The easiest way to bubble the revert reason is using memory via assembly
// solhint-disable-next-line no-inline-assembly
assembly {
let returndata_size := mload(returndata)
revert(add(32, returndata), returndata_size)
}
} else {
revert(errorMessage);
}
}
}
}// SPDX-License-Identifier: MIT
pragma solidity ^0.5.15;
/**
* @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);
}// SPDX-License-Identifier: MIT
pragma solidity ^0.5.15;
import "./IERC20.sol";
import "./SafeMath.sol";
import "./Address.sol";
/**
* @title SafeERC20
* @dev Wrappers around ERC20 operations that throw on failure (when the token
* contract returns false). Tokens that return no value (and instead revert or
* throw on failure) are also supported, non-reverting calls are assumed to be
* successful.
* To use this library you can add a `using SafeERC20 for IERC20;` statement to your contract,
* which allows you to call the safe operations as `token.safeTransfer(...)`, etc.
*/
library SafeERC20 {
using SafeMath for uint256;
using Address for address;
function safeTransfer(IERC20 token, address to, uint256 value) internal {
_callOptionalReturn(token, abi.encodeWithSelector(token.transfer.selector, to, value));
}
function safeTransferFrom(IERC20 token, address from, address to, uint256 value) internal {
_callOptionalReturn(token, abi.encodeWithSelector(token.transferFrom.selector, from, to, value));
}
/**
* @dev Deprecated. This function has issues similar to the ones found in
* {IERC20-approve}, and its usage is discouraged.
*
* Whenever possible, use {safeIncreaseAllowance} and
* {safeDecreaseAllowance} instead.
*/
function safeApprove(IERC20 token, address spender, uint256 value) internal {
// safeApprove should only be called when setting an initial allowance,
// or when resetting it to zero. To increase and decrease it, use
// 'safeIncreaseAllowance' and 'safeDecreaseAllowance'
// solhint-disable-next-line max-line-length
require((value == 0) || (token.allowance(address(this), spender) == 0),
"SafeERC20: approve from non-zero to non-zero allowance"
);
_callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, value));
}
function safeIncreaseAllowance(IERC20 token, address spender, uint256 value) internal {
uint256 newAllowance = token.allowance(address(this), spender).add(value);
_callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance));
}
function safeDecreaseAllowance(IERC20 token, address spender, uint256 value) internal {
uint256 newAllowance = token.allowance(address(this), spender).sub(value, "SafeERC20: decreased allowance below zero");
_callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance));
}
/**
* @dev Imitates a Solidity high-level call (i.e. a regular function call to a contract), relaxing the requirement
* on the return value: the return value is optional (but if data is returned, it must not be false).
* @param token The token targeted by the call.
* @param data The call data (encoded using abi.encode or one of its variants).
*/
function _callOptionalReturn(IERC20 token, bytes memory data) private {
// We need to perform a low level call here, to bypass Solidity's return data size checking mechanism, since
// we're implementing it ourselves. We use {Address.functionCall} to perform this call, which verifies that
// the target address contains contract code and also asserts for success in the low-level call.
bytes memory returndata = address(token).functionCall(data, "SafeERC20: low-level call failed");
if (returndata.length > 0) { // Return data is optional
// solhint-disable-next-line max-line-length
require(abi.decode(returndata, (bool)), "SafeERC20: ERC20 operation did not succeed");
}
}
}// SPDX-License-Identifier: MIT
pragma solidity ^0.5.15;
/**
* @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;
}
}{
"remappings": [],
"optimizer": {
"enabled": true,
"runs": 50000
},
"evmVersion": "istanbul",
"libraries": {},
"outputSelection": {
"*": {
"*": [
"evm.bytecode",
"evm.deployedBytecode",
"abi"
]
}
}
}Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
[{"inputs":[{"internalType":"string","name":"name_","type":"string"},{"internalType":"string","name":"symbol_","type":"string"},{"internalType":"uint8","name":"decimals_","type":"uint8"},{"internalType":"uint256","name":"initTotalSupply_","type":"uint256"},{"internalType":"address","name":"implementation_","type":"address"},{"internalType":"bytes","name":"becomeImplementationData","type":"bytes"}],"payable":false,"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":true,"internalType":"address","name":"spender","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"Approval","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"from","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"Burn","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"delegator","type":"address"},{"indexed":true,"internalType":"address","name":"fromDelegate","type":"address"},{"indexed":true,"internalType":"address","name":"toDelegate","type":"address"}],"name":"DelegateChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"delegate","type":"address"},{"indexed":false,"internalType":"uint256","name":"previousBalance","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"newBalance","type":"uint256"}],"name":"DelegateVotesChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"to","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"Mint","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"oldBanker","type":"address"},{"indexed":false,"internalType":"address","name":"newBanker","type":"address"}],"name":"NewBanker","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"oldGov","type":"address"},{"indexed":false,"internalType":"address","name":"newGov","type":"address"}],"name":"NewGov","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"oldImplementation","type":"address"},{"indexed":false,"internalType":"address","name":"newImplementation","type":"address"}],"name":"NewImplementation","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"oldIncentivizer","type":"address"},{"indexed":false,"internalType":"address","name":"newIncentivizer","type":"address"}],"name":"NewIncentivizer","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"oldPendingGov","type":"address"},{"indexed":false,"internalType":"address","name":"newPendingGov","type":"address"}],"name":"NewPendingGov","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"oldRebaser","type":"address"},{"indexed":false,"internalType":"address","name":"newRebaser","type":"address"}],"name":"NewRebaser","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"epoch","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"previTokensScalingFactor","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"newiTokensScalingFactor","type":"uint256"}],"name":"Rebase","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"Transfer","type":"event"},{"payable":true,"stateMutability":"payable","type":"fallback"},{"constant":true,"inputs":[],"name":"BASE","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"DELEGATION_TYPEHASH","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"DOMAIN_SEPARATOR","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"DOMAIN_TYPEHASH","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"PERMIT_TYPEHASH","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[],"name":"_acceptGov","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"internalType":"address","name":"banker_","type":"address"}],"name":"_setBanker","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"internalType":"address","name":"implementation_","type":"address"},{"internalType":"bool","name":"allowResign","type":"bool"},{"internalType":"bytes","name":"becomeImplementationData","type":"bytes"}],"name":"_setImplementation","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"internalType":"address","name":"incentivizer_","type":"address"}],"name":"_setIncentivizer","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"internalType":"address","name":"newPendingGov","type":"address"}],"name":"_setPendingGov","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"internalType":"address","name":"rebaser_","type":"address"}],"name":"_setRebaser","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"address","name":"spender","type":"address"}],"name":"allowance","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"internalType":"address","name":"spender","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"approve","outputs":[{"internalType":"bool","name":"","type":"bool"}],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[{"internalType":"address","name":"owner","type":"address"}],"name":"balanceOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"internalType":"address","name":"owner","type":"address"}],"name":"balanceOfUnderlying","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"banker","outputs":[{"internalType":"address","name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"burn","outputs":[{"internalType":"bool","name":"","type":"bool"}],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"internalType":"address","name":"src","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"burnFrom","outputs":[{"internalType":"bool","name":"","type":"bool"}],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[{"internalType":"address","name":"","type":"address"},{"internalType":"uint32","name":"","type":"uint32"}],"name":"checkpoints","outputs":[{"internalType":"uint32","name":"fromBlock","type":"uint32"},{"internalType":"uint256","name":"votes","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"decimals","outputs":[{"internalType":"uint8","name":"","type":"uint8"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"internalType":"address","name":"spender","type":"address"},{"internalType":"uint256","name":"subtractedValue","type":"uint256"}],"name":"decreaseAllowance","outputs":[{"internalType":"bool","name":"","type":"bool"}],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"internalType":"address","name":"delegatee","type":"address"}],"name":"delegate","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"internalType":"address","name":"delegatee","type":"address"},{"internalType":"uint256","name":"nonce","type":"uint256"},{"internalType":"uint256","name":"expiry","type":"uint256"},{"internalType":"uint8","name":"v","type":"uint8"},{"internalType":"bytes32","name":"r","type":"bytes32"},{"internalType":"bytes32","name":"s","type":"bytes32"}],"name":"delegateBySig","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"internalType":"bytes","name":"data","type":"bytes"}],"name":"delegateToImplementation","outputs":[{"internalType":"bytes","name":"","type":"bytes"}],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[{"internalType":"bytes","name":"data","type":"bytes"}],"name":"delegateToViewImplementation","outputs":[{"internalType":"bytes","name":"","type":"bytes"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"internalType":"address","name":"delegator","type":"address"}],"name":"delegates","outputs":[{"internalType":"address","name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"internalType":"uint256","name":"value","type":"uint256"}],"name":"fragmentToiToken","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"getCurrentVotes","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"internalType":"address","name":"account","type":"address"},{"internalType":"uint256","name":"blockNumber","type":"uint256"}],"name":"getPriorVotes","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"gov","outputs":[{"internalType":"address","name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"implementation","outputs":[{"internalType":"address","name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"incentivizer","outputs":[{"internalType":"address","name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"internalType":"address","name":"spender","type":"address"},{"internalType":"uint256","name":"addedValue","type":"uint256"}],"name":"increaseAllowance","outputs":[{"internalType":"bool","name":"","type":"bool"}],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"initSupply","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"internalDecimals","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"internalType":"uint256","name":"itoken","type":"uint256"}],"name":"itokenToFragment","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"itokensScalingFactor","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"maxScalingFactor","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"mintAmount","type":"uint256"}],"name":"mint","outputs":[{"internalType":"bool","name":"","type":"bool"}],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"name","outputs":[{"internalType":"string","name":"","type":"string"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"nonces","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"numCheckpoints","outputs":[{"internalType":"uint32","name":"","type":"uint32"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"pendingGov","outputs":[{"internalType":"address","name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"address","name":"spender","type":"address"},{"internalType":"uint256","name":"value","type":"uint256"},{"internalType":"uint256","name":"deadline","type":"uint256"},{"internalType":"uint8","name":"v","type":"uint8"},{"internalType":"bytes32","name":"r","type":"bytes32"},{"internalType":"bytes32","name":"s","type":"bytes32"}],"name":"permit","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"internalType":"uint256","name":"epoch","type":"uint256"},{"internalType":"uint256","name":"indexDelta","type":"uint256"},{"internalType":"bool","name":"positive","type":"bool"}],"name":"rebase","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"rebaser","outputs":[{"internalType":"address","name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"internalType":"address","name":"token","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"rescueTokens","outputs":[{"internalType":"bool","name":"","type":"bool"}],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"symbol","outputs":[{"internalType":"string","name":"","type":"string"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"totalSupply","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"internalType":"address","name":"dst","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"transfer","outputs":[{"internalType":"bool","name":"","type":"bool"}],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"internalType":"address","name":"src","type":"address"},{"internalType":"address","name":"dst","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"transferFrom","outputs":[{"internalType":"bool","name":"","type":"bool"}],"payable":false,"stateMutability":"nonpayable","type":"function"}]Contract Creation Code
60806040523480156200001157600080fd5b506040516200201d3803806200201d833981810160405260c08110156200003757600080fd5b81019080805160405193929190846401000000008211156200005857600080fd5b9083019060208201858111156200006e57600080fd5b82516401000000008111828201881017156200008957600080fd5b82525081516020918201929091019080838360005b83811015620000b85781810151838201526020016200009e565b50505050905090810190601f168015620000e65780820380516001836020036101000a031916815260200191505b50604052602001805160405193929190846401000000008211156200010a57600080fd5b9083019060208201858111156200012057600080fd5b82516401000000008111828201881017156200013b57600080fd5b82525081516020918201929091019080838360005b838110156200016a57818101518382015260200162000150565b50505050905090810190601f168015620001985780820380516001836020036101000a031916815260200191505b50604081815260208301519083015160608401516080909401805192969195919284640100000000821115620001cd57600080fd5b908301906020820185811115620001e357600080fd5b8251640100000000811182820188101715620001fe57600080fd5b82525081516020918201929091019080838360005b838110156200022d57818101518382015260200162000213565b50505050905090810190601f1680156200025b5780820380516001836020036101000a031916815260200191505b5060405250505033600360016101000a8154816001600160a01b0302191690836001600160a01b03160217905550620003d48287878733886040516024018080602001806020018660ff1660ff168152602001856001600160a01b03166001600160a01b03168152602001848152602001838103835288818151815260200191508051906020019080838360005b8381101562000303578181015183820152602001620002e9565b50505050905090810190601f168015620003315780820380516001836020036101000a031916815260200191505b50838103825287518152875160209182019189019080838360005b83811015620003665781810151838201526020016200034c565b50505050905090810190601f168015620003945780820380516001836020036101000a031916815260200191505b5060408051601f198184030181529190526020810180516001600160e01b03908116636c94522160e01b17909152909850620003f8169650505050505050565b50620003ec826000836001600160e01b03620004bf16565b505050505050620006a0565b606060006060846001600160a01b0316846040518082805190602001908083835b602083106200043a5780518252601f19909201916020918201910162000419565b6001836020036101000a038019825116818451168082178552505050505050905001915050600060405180830381855af49150503d80600081146200049c576040519150601f19603f3d011682016040523d82523d6000602084013e620004a1565b606091505b50915091506000821415620004b7573d60208201fd5b949350505050565b60035461010090046001600160a01b031633146200050f5760405162461bcd60e51b815260040180806020018281038252603781526020018062001fe66037913960400191505060405180910390fd5b811562000551576040805160048152602481019091526020810180516001600160e01b0390811663153ab50560e01b179091526200054f91906200067616565b505b601280546001600160a01b038581166001600160a01b0319831617909255604051602060248201818152855160448401528551949093169362000627938693909283926064909201919085019080838360005b83811015620005be578181015183820152602001620005a4565b50505050905090810190601f168015620005ec5780820380516001836020036101000a031916815260200191505b5060408051601f198184030181529190526020810180516001600160e01b03908116630adccee560e31b179091529093506200067616915050565b50601254604080516001600160a01b038085168252909216602083015280517fd604de94d45953f9138079ec1b82d533cb2160c906d1076d1f7ed54befbca97a9281900390910190a150505050565b6012546060906200069a906001600160a01b0316836001600160e01b03620003f816565b92915050565b61193680620006b06000396000f3fe6080604052600436106103345760003560e01c80635c19a95c116101b057806397d63f93116100ec578063cea9d26f11610095578063e7a324dc1161006f578063e7a324dc14610be1578063ec342ad014610bf6578063f1127ed814610c0b578063fa8f34551461067557610334565b8063cea9d26f14610610578063d505accf14610b2e578063dd62ed3e14610b9957610334565b8063a9059cbb116100c6578063a9059cbb146104d3578063b4b5ea571461070c578063c3cda52014610acd57610334565b806397d63f9314610ab857806398dca21014610675578063a457c2d7146104d357610334565b806370a082311161015957806379cc67901161013357806379cc6790146104d35780637af548c114610a2b5780637ecebe0014610a6357806395d89b4114610aa357610334565b806370a082311461070c57806373f03dff14610675578063782d6fe1146109e557610334565b8063661157441161018a57806366115744146105bc5780636fc6407c146109775780636fcfff451461098c57610334565b80635c19a95c146106755780635c60da1b1461094d57806364dd48f51461096257610334565b8063309681a11161027f57806340c10f191161022857806345d1292c1161020257806345d1292c146108295780634bda2e201461083e578063555bcc4014610853578063587cde1e1461092a57610334565b806340c10f19146104d357806342966c681461074c5780634487152f1461077657610334565b80633644e515116102595780633644e515146106f757806339509351146104d35780633af9e6691461070c57610334565b8063309681a11461067557806330adf81f146106b7578063313ce567146106cc57610334565b806312d43a51116102e157806320606b70116102bb57806320606b70146105fb57806323b872dd14610610578063252408101461066057610334565b806312d43a51146105a757806317eae7e9146105bc57806318160ddd146105e657610334565b80630ab9db5b116103125780630ab9db5b1461052d57806311d3e6c41461056b57806311fd8a831461059257610334565b806306fdde03146103965780630933c1ed14610420578063095ea7b3146104d3575b341561038b576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260378152602001806118916037913960400191505060405180910390fd5b610393610c77565b50005b3480156103a257600080fd5b506103ab610d0c565b6040805160208082528351818301528351919283929083019185019080838360005b838110156103e55781810151838201526020016103cd565b50505050905090810190601f1680156104125780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561042c57600080fd5b506103ab6004803603602081101561044357600080fd5b81019060208101813564010000000081111561045e57600080fd5b82018360208201111561047057600080fd5b8035906020019184600183028401116401000000008311171561049257600080fd5b91908080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250929550610db7945050505050565b3480156104df57600080fd5b50610519600480360360408110156104f657600080fd5b5073ffffffffffffffffffffffffffffffffffffffff8135169060200135610de3565b604080519115158252519081900360200190f35b34801561053957600080fd5b50610542610df4565b6040805173ffffffffffffffffffffffffffffffffffffffff9092168252519081900360200190f35b34801561057757600080fd5b50610580610e10565b60408051918252519081900360200190f35b34801561059e57600080fd5b50610542610e1e565b3480156105b357600080fd5b50610542610e3a565b3480156105c857600080fd5b50610580600480360360208110156105df57600080fd5b5035610e5b565b3480156105f257600080fd5b50610580610e6b565b34801561060757600080fd5b50610580610e71565b34801561061c57600080fd5b506105196004803603606081101561063357600080fd5b5073ffffffffffffffffffffffffffffffffffffffff813581169160208101359091169060400135610e8c565b34801561066c57600080fd5b50610542610e9e565b34801561068157600080fd5b506106b56004803603602081101561069857600080fd5b503573ffffffffffffffffffffffffffffffffffffffff16610eba565b005b3480156106c357600080fd5b50610580610ec6565b3480156106d857600080fd5b506106e1610eea565b6040805160ff9092168252519081900360200190f35b34801561070357600080fd5b50610580610ef3565b34801561071857600080fd5b506105806004803603602081101561072f57600080fd5b503573ffffffffffffffffffffffffffffffffffffffff16610e5b565b34801561075857600080fd5b506105196004803603602081101561076f57600080fd5b5035610ef9565b34801561078257600080fd5b506103ab6004803603602081101561079957600080fd5b8101906020810181356401000000008111156107b457600080fd5b8201836020820111156107c657600080fd5b803590602001918460018302840111640100000000831117156107e857600080fd5b91908080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250929550610f03945050505050565b34801561083557600080fd5b5061058061119b565b34801561084a57600080fd5b506106b56111a1565b34801561085f57600080fd5b506106b56004803603606081101561087657600080fd5b73ffffffffffffffffffffffffffffffffffffffff8235169160208101351515918101906060810160408201356401000000008111156108b557600080fd5b8201836020820111156108c757600080fd5b803590602001918460018302840111640100000000831117156108e957600080fd5b91908080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152509295506111ac945050505050565b34801561093657600080fd5b506105426004803603602081101561072f57600080fd5b34801561095957600080fd5b50610542611422565b34801561096e57600080fd5b5061058061143e565b34801561098357600080fd5b5061054261144c565b34801561099857600080fd5b506109cc600480360360208110156109af57600080fd5b503573ffffffffffffffffffffffffffffffffffffffff16611468565b6040805163ffffffff9092168252519081900360200190f35b3480156109f157600080fd5b5061058060048036036040811015610a0857600080fd5b5073ffffffffffffffffffffffffffffffffffffffff8135169060200135611480565b348015610a3757600080fd5b5061058060048036036060811015610a4e57600080fd5b50803590602081013590604001351515610e8c565b348015610a6f57600080fd5b5061058060048036036020811015610a8657600080fd5b503573ffffffffffffffffffffffffffffffffffffffff1661148a565b348015610aaf57600080fd5b506103ab61149c565b348015610ac457600080fd5b50610580611512565b348015610ad957600080fd5b506106b5600480360360c0811015610af057600080fd5b5073ffffffffffffffffffffffffffffffffffffffff8135169060208101359060408101359060ff6060820135169060808101359060a00135611518565b348015610b3a57600080fd5b506106b5600480360360e0811015610b5157600080fd5b5073ffffffffffffffffffffffffffffffffffffffff813581169160208101359091169060408101359060608101359060ff6080820135169060a08101359060c00135611529565b348015610ba557600080fd5b5061058060048036036040811015610bbc57600080fd5b5073ffffffffffffffffffffffffffffffffffffffff81358116916020013516611480565b348015610bed57600080fd5b5061058061153b565b348015610c0257600080fd5b50610580611556565b348015610c1757600080fd5b50610c5760048036036040811015610c2e57600080fd5b50803573ffffffffffffffffffffffffffffffffffffffff16906020013563ffffffff16611562565b6040805163ffffffff909316835260208301919091528051918290030190f35b60125460405160609160009173ffffffffffffffffffffffffffffffffffffffff90911690829036908083838082843760405192019450600093509091505080830381855af49150503d8060008114610cec576040519150601f19603f3d011682016040523d82523d6000602084013e610cf1565b606091505b505090506040513d6000823e818015610d08573d82f35b3d82fd5b60018054604080516020600284861615610100027fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0190941693909304601f81018490048402820184019092528181529291830182828015610daf5780601f10610d8457610100808354040283529160200191610daf565b820191906000526020600020905b815481529060010190602001808311610d9257829003601f168201915b505050505081565b601254606090610ddd9073ffffffffffffffffffffffffffffffffffffffff168361158f565b92915050565b6000610ded610c77565b5092915050565b60075473ffffffffffffffffffffffffffffffffffffffff1681565b6000610e1a61167c565b5090565b60055473ffffffffffffffffffffffffffffffffffffffff1681565b600354610100900473ffffffffffffffffffffffffffffffffffffffff1681565b6000610e6561167c565b50919050565b60085481565b60405180604361184e82396043019050604051809103902081565b6000610e96610c77565b509392505050565b60045473ffffffffffffffffffffffffffffffffffffffff1681565b610ec2610c77565b5050565b7f6e71edae12b1b97f4d1f60370fef10105fa2faae0126114a169c64845d6126c981565b60035460ff1681565b600d5481565b6000610e65610c77565b6060600060603073ffffffffffffffffffffffffffffffffffffffff16846040516024018080602001828103825283818151815260200191508051906020019080838360005b83811015610f61578181015183820152602001610f49565b50505050905090810190601f168015610f8e5780820380516001836020036101000a031916815260200191505b50604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe08184030181529181526020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167f0933c1ed00000000000000000000000000000000000000000000000000000000178152905182519295509350839250908083835b6020831061105357805182527fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe09092019160209182019101611016565b6001836020036101000a038019825116818451168082178552505050505050905001915050600060405180830381855afa9150503d80600081146110b3576040519150601f19603f3d011682016040523d82523d6000602084013e6110b8565b606091505b509150915060008214156110cd573d60208201fd5b8080602001905160208110156110e257600080fd5b810190808051604051939291908464010000000082111561110257600080fd5b90830190602082018581111561111757600080fd5b825164010000000081118282018810171561113157600080fd5b82525081516020918201929091019080838360005b8381101561115e578181015183820152602001611146565b50505050905090810190601f16801561118b5780820380516001836020036101000a031916815260200191505b5060405250505092505050919050565b60095481565b6111a9610c77565b50565b600354610100900473ffffffffffffffffffffffffffffffffffffffff163314611221576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260378152602001806118176037913960400191505060405180910390fd5b8115611289576040805160048152602481019091526020810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167f153ab5050000000000000000000000000000000000000000000000000000000017905261128790610db7565b505b6012805473ffffffffffffffffffffffffffffffffffffffff8581167fffffffffffffffffffffffff000000000000000000000000000000000000000083161790925560405160206024820181815285516044840152855194909316936113c6938693909283926064909201919085019080838360005b83811015611318578181015183820152602001611300565b50505050905090810190601f1680156113455780820380516001836020036101000a031916815260200191505b50604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe08184030181529190526020810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167f56e67728000000000000000000000000000000000000000000000000000000001790529250610db7915050565b506012546040805173ffffffffffffffffffffffffffffffffffffffff8085168252909216602083015280517fd604de94d45953f9138079ec1b82d533cb2160c906d1076d1f7ed54befbca97a9281900390910190a150505050565b60125473ffffffffffffffffffffffffffffffffffffffff1681565b69d3c21bcecceda100000081565b60065473ffffffffffffffffffffffffffffffffffffffff1681565b60106020526000908152604090205463ffffffff1681565b6000610ded61167c565b60116020526000908152604090205481565b600280546040805160206001841615610100027fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff01909316849004601f81018490048402820184019092528181529291830182828015610daf5780601f10610d8457610100808354040283529160200191610daf565b600c5481565b611520610c77565b50505050505050565b611531610c77565b5050505050505050565b60405180603a6118c88239603a019050604051809103902081565b670de0b6b3a764000081565b600f6020908152600092835260408084209091529082529020805460019091015463ffffffff9091169082565b6060600060608473ffffffffffffffffffffffffffffffffffffffff16846040518082805190602001908083835b602083106115fa57805182527fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe090920191602091820191016115bd565b6001836020036101000a038019825116818451168082178552505050505050905001915050600060405180830381855af49150503d806000811461165a576040519150601f19603f3d011682016040523d82523d6000602084013e61165f565b606091505b50915091506000821415611674573d60208201fd5b949350505050565b606060003073ffffffffffffffffffffffffffffffffffffffff166000366040516024018080602001828103825284848281815260200192508082843760008382015260408051601f9092017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe090811690940182810390940182529283526020810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167f0933c1ed0000000000000000000000000000000000000000000000000000000017815292518151919750955085945091925081905083835b6020831061179457805182527fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe09092019160209182019101611757565b6001836020036101000a038019825116818451168082178552505050505050905001915050600060405180830381855afa9150503d80600081146117f4576040519150601f19603f3d011682016040523d82523d6000602084013e6117f9565b606091505b505090506040513d6000823e818015610d085760403d0360408301f3fe69546f6b656e44656c656761746f723a3a5f736574496d706c656d656e746174696f6e3a2043616c6c6572206d75737420626520676f76454950373132446f6d61696e28737472696e67206e616d652c75696e7432353620636861696e49642c6164647265737320766572696679696e67436f6e74726163742969546f6b656e44656c656761746f723a66616c6c6261636b3a2063616e6e6f742073656e642076616c756520746f2066616c6c6261636b44656c65676174696f6e28616464726573732064656c6567617465652c75696e74323536206e6f6e63652c75696e743235362065787069727929a265627a7a723158206843bc98f7d63c4d4731dc92f93af29d3272cf04da33000390a6ab042caa8fe464736f6c6343000511003269546f6b656e44656c656761746f723a3a5f736574496d706c656d656e746174696f6e3a2043616c6c6572206d75737420626520676f7600000000000000000000000000000000000000000000000000000000000000c00000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000001200000000000000000000000000000000000000000000000000005af3107a4000000000000000000000000000ff43c3067f926872b072a33457d3db45a2134d9f0000000000000000000000000000000000000000000000000000000000000140000000000000000000000000000000000000000000000000000000000000000d526963655175616e742042544300000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000472425443000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
Deployed Bytecode
0x6080604052600436106103345760003560e01c80635c19a95c116101b057806397d63f93116100ec578063cea9d26f11610095578063e7a324dc1161006f578063e7a324dc14610be1578063ec342ad014610bf6578063f1127ed814610c0b578063fa8f34551461067557610334565b8063cea9d26f14610610578063d505accf14610b2e578063dd62ed3e14610b9957610334565b8063a9059cbb116100c6578063a9059cbb146104d3578063b4b5ea571461070c578063c3cda52014610acd57610334565b806397d63f9314610ab857806398dca21014610675578063a457c2d7146104d357610334565b806370a082311161015957806379cc67901161013357806379cc6790146104d35780637af548c114610a2b5780637ecebe0014610a6357806395d89b4114610aa357610334565b806370a082311461070c57806373f03dff14610675578063782d6fe1146109e557610334565b8063661157441161018a57806366115744146105bc5780636fc6407c146109775780636fcfff451461098c57610334565b80635c19a95c146106755780635c60da1b1461094d57806364dd48f51461096257610334565b8063309681a11161027f57806340c10f191161022857806345d1292c1161020257806345d1292c146108295780634bda2e201461083e578063555bcc4014610853578063587cde1e1461092a57610334565b806340c10f19146104d357806342966c681461074c5780634487152f1461077657610334565b80633644e515116102595780633644e515146106f757806339509351146104d35780633af9e6691461070c57610334565b8063309681a11461067557806330adf81f146106b7578063313ce567146106cc57610334565b806312d43a51116102e157806320606b70116102bb57806320606b70146105fb57806323b872dd14610610578063252408101461066057610334565b806312d43a51146105a757806317eae7e9146105bc57806318160ddd146105e657610334565b80630ab9db5b116103125780630ab9db5b1461052d57806311d3e6c41461056b57806311fd8a831461059257610334565b806306fdde03146103965780630933c1ed14610420578063095ea7b3146104d3575b341561038b576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260378152602001806118916037913960400191505060405180910390fd5b610393610c77565b50005b3480156103a257600080fd5b506103ab610d0c565b6040805160208082528351818301528351919283929083019185019080838360005b838110156103e55781810151838201526020016103cd565b50505050905090810190601f1680156104125780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561042c57600080fd5b506103ab6004803603602081101561044357600080fd5b81019060208101813564010000000081111561045e57600080fd5b82018360208201111561047057600080fd5b8035906020019184600183028401116401000000008311171561049257600080fd5b91908080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250929550610db7945050505050565b3480156104df57600080fd5b50610519600480360360408110156104f657600080fd5b5073ffffffffffffffffffffffffffffffffffffffff8135169060200135610de3565b604080519115158252519081900360200190f35b34801561053957600080fd5b50610542610df4565b6040805173ffffffffffffffffffffffffffffffffffffffff9092168252519081900360200190f35b34801561057757600080fd5b50610580610e10565b60408051918252519081900360200190f35b34801561059e57600080fd5b50610542610e1e565b3480156105b357600080fd5b50610542610e3a565b3480156105c857600080fd5b50610580600480360360208110156105df57600080fd5b5035610e5b565b3480156105f257600080fd5b50610580610e6b565b34801561060757600080fd5b50610580610e71565b34801561061c57600080fd5b506105196004803603606081101561063357600080fd5b5073ffffffffffffffffffffffffffffffffffffffff813581169160208101359091169060400135610e8c565b34801561066c57600080fd5b50610542610e9e565b34801561068157600080fd5b506106b56004803603602081101561069857600080fd5b503573ffffffffffffffffffffffffffffffffffffffff16610eba565b005b3480156106c357600080fd5b50610580610ec6565b3480156106d857600080fd5b506106e1610eea565b6040805160ff9092168252519081900360200190f35b34801561070357600080fd5b50610580610ef3565b34801561071857600080fd5b506105806004803603602081101561072f57600080fd5b503573ffffffffffffffffffffffffffffffffffffffff16610e5b565b34801561075857600080fd5b506105196004803603602081101561076f57600080fd5b5035610ef9565b34801561078257600080fd5b506103ab6004803603602081101561079957600080fd5b8101906020810181356401000000008111156107b457600080fd5b8201836020820111156107c657600080fd5b803590602001918460018302840111640100000000831117156107e857600080fd5b91908080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250929550610f03945050505050565b34801561083557600080fd5b5061058061119b565b34801561084a57600080fd5b506106b56111a1565b34801561085f57600080fd5b506106b56004803603606081101561087657600080fd5b73ffffffffffffffffffffffffffffffffffffffff8235169160208101351515918101906060810160408201356401000000008111156108b557600080fd5b8201836020820111156108c757600080fd5b803590602001918460018302840111640100000000831117156108e957600080fd5b91908080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152509295506111ac945050505050565b34801561093657600080fd5b506105426004803603602081101561072f57600080fd5b34801561095957600080fd5b50610542611422565b34801561096e57600080fd5b5061058061143e565b34801561098357600080fd5b5061054261144c565b34801561099857600080fd5b506109cc600480360360208110156109af57600080fd5b503573ffffffffffffffffffffffffffffffffffffffff16611468565b6040805163ffffffff9092168252519081900360200190f35b3480156109f157600080fd5b5061058060048036036040811015610a0857600080fd5b5073ffffffffffffffffffffffffffffffffffffffff8135169060200135611480565b348015610a3757600080fd5b5061058060048036036060811015610a4e57600080fd5b50803590602081013590604001351515610e8c565b348015610a6f57600080fd5b5061058060048036036020811015610a8657600080fd5b503573ffffffffffffffffffffffffffffffffffffffff1661148a565b348015610aaf57600080fd5b506103ab61149c565b348015610ac457600080fd5b50610580611512565b348015610ad957600080fd5b506106b5600480360360c0811015610af057600080fd5b5073ffffffffffffffffffffffffffffffffffffffff8135169060208101359060408101359060ff6060820135169060808101359060a00135611518565b348015610b3a57600080fd5b506106b5600480360360e0811015610b5157600080fd5b5073ffffffffffffffffffffffffffffffffffffffff813581169160208101359091169060408101359060608101359060ff6080820135169060a08101359060c00135611529565b348015610ba557600080fd5b5061058060048036036040811015610bbc57600080fd5b5073ffffffffffffffffffffffffffffffffffffffff81358116916020013516611480565b348015610bed57600080fd5b5061058061153b565b348015610c0257600080fd5b50610580611556565b348015610c1757600080fd5b50610c5760048036036040811015610c2e57600080fd5b50803573ffffffffffffffffffffffffffffffffffffffff16906020013563ffffffff16611562565b6040805163ffffffff909316835260208301919091528051918290030190f35b60125460405160609160009173ffffffffffffffffffffffffffffffffffffffff90911690829036908083838082843760405192019450600093509091505080830381855af49150503d8060008114610cec576040519150601f19603f3d011682016040523d82523d6000602084013e610cf1565b606091505b505090506040513d6000823e818015610d08573d82f35b3d82fd5b60018054604080516020600284861615610100027fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0190941693909304601f81018490048402820184019092528181529291830182828015610daf5780601f10610d8457610100808354040283529160200191610daf565b820191906000526020600020905b815481529060010190602001808311610d9257829003601f168201915b505050505081565b601254606090610ddd9073ffffffffffffffffffffffffffffffffffffffff168361158f565b92915050565b6000610ded610c77565b5092915050565b60075473ffffffffffffffffffffffffffffffffffffffff1681565b6000610e1a61167c565b5090565b60055473ffffffffffffffffffffffffffffffffffffffff1681565b600354610100900473ffffffffffffffffffffffffffffffffffffffff1681565b6000610e6561167c565b50919050565b60085481565b60405180604361184e82396043019050604051809103902081565b6000610e96610c77565b509392505050565b60045473ffffffffffffffffffffffffffffffffffffffff1681565b610ec2610c77565b5050565b7f6e71edae12b1b97f4d1f60370fef10105fa2faae0126114a169c64845d6126c981565b60035460ff1681565b600d5481565b6000610e65610c77565b6060600060603073ffffffffffffffffffffffffffffffffffffffff16846040516024018080602001828103825283818151815260200191508051906020019080838360005b83811015610f61578181015183820152602001610f49565b50505050905090810190601f168015610f8e5780820380516001836020036101000a031916815260200191505b50604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe08184030181529181526020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167f0933c1ed00000000000000000000000000000000000000000000000000000000178152905182519295509350839250908083835b6020831061105357805182527fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe09092019160209182019101611016565b6001836020036101000a038019825116818451168082178552505050505050905001915050600060405180830381855afa9150503d80600081146110b3576040519150601f19603f3d011682016040523d82523d6000602084013e6110b8565b606091505b509150915060008214156110cd573d60208201fd5b8080602001905160208110156110e257600080fd5b810190808051604051939291908464010000000082111561110257600080fd5b90830190602082018581111561111757600080fd5b825164010000000081118282018810171561113157600080fd5b82525081516020918201929091019080838360005b8381101561115e578181015183820152602001611146565b50505050905090810190601f16801561118b5780820380516001836020036101000a031916815260200191505b5060405250505092505050919050565b60095481565b6111a9610c77565b50565b600354610100900473ffffffffffffffffffffffffffffffffffffffff163314611221576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260378152602001806118176037913960400191505060405180910390fd5b8115611289576040805160048152602481019091526020810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167f153ab5050000000000000000000000000000000000000000000000000000000017905261128790610db7565b505b6012805473ffffffffffffffffffffffffffffffffffffffff8581167fffffffffffffffffffffffff000000000000000000000000000000000000000083161790925560405160206024820181815285516044840152855194909316936113c6938693909283926064909201919085019080838360005b83811015611318578181015183820152602001611300565b50505050905090810190601f1680156113455780820380516001836020036101000a031916815260200191505b50604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe08184030181529190526020810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167f56e67728000000000000000000000000000000000000000000000000000000001790529250610db7915050565b506012546040805173ffffffffffffffffffffffffffffffffffffffff8085168252909216602083015280517fd604de94d45953f9138079ec1b82d533cb2160c906d1076d1f7ed54befbca97a9281900390910190a150505050565b60125473ffffffffffffffffffffffffffffffffffffffff1681565b69d3c21bcecceda100000081565b60065473ffffffffffffffffffffffffffffffffffffffff1681565b60106020526000908152604090205463ffffffff1681565b6000610ded61167c565b60116020526000908152604090205481565b600280546040805160206001841615610100027fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff01909316849004601f81018490048402820184019092528181529291830182828015610daf5780601f10610d8457610100808354040283529160200191610daf565b600c5481565b611520610c77565b50505050505050565b611531610c77565b5050505050505050565b60405180603a6118c88239603a019050604051809103902081565b670de0b6b3a764000081565b600f6020908152600092835260408084209091529082529020805460019091015463ffffffff9091169082565b6060600060608473ffffffffffffffffffffffffffffffffffffffff16846040518082805190602001908083835b602083106115fa57805182527fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe090920191602091820191016115bd565b6001836020036101000a038019825116818451168082178552505050505050905001915050600060405180830381855af49150503d806000811461165a576040519150601f19603f3d011682016040523d82523d6000602084013e61165f565b606091505b50915091506000821415611674573d60208201fd5b949350505050565b606060003073ffffffffffffffffffffffffffffffffffffffff166000366040516024018080602001828103825284848281815260200192508082843760008382015260408051601f9092017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe090811690940182810390940182529283526020810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167f0933c1ed0000000000000000000000000000000000000000000000000000000017815292518151919750955085945091925081905083835b6020831061179457805182527fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe09092019160209182019101611757565b6001836020036101000a038019825116818451168082178552505050505050905001915050600060405180830381855afa9150503d80600081146117f4576040519150601f19603f3d011682016040523d82523d6000602084013e6117f9565b606091505b505090506040513d6000823e818015610d085760403d0360408301f3fe69546f6b656e44656c656761746f723a3a5f736574496d706c656d656e746174696f6e3a2043616c6c6572206d75737420626520676f76454950373132446f6d61696e28737472696e67206e616d652c75696e7432353620636861696e49642c6164647265737320766572696679696e67436f6e74726163742969546f6b656e44656c656761746f723a66616c6c6261636b3a2063616e6e6f742073656e642076616c756520746f2066616c6c6261636b44656c65676174696f6e28616464726573732064656c6567617465652c75696e74323536206e6f6e63652c75696e743235362065787069727929a265627a7a723158206843bc98f7d63c4d4731dc92f93af29d3272cf04da33000390a6ab042caa8fe464736f6c63430005110032
Constructor Arguments (ABI-Encoded and is the last bytes of the Contract Creation Code above)
00000000000000000000000000000000000000000000000000000000000000c00000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000001200000000000000000000000000000000000000000000000000005af3107a4000000000000000000000000000ff43c3067f926872b072a33457d3db45a2134d9f0000000000000000000000000000000000000000000000000000000000000140000000000000000000000000000000000000000000000000000000000000000d526963655175616e742042544300000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000472425443000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
-----Decoded View---------------
Arg [0] : name_ (string): RiceQuant BTC
Arg [1] : symbol_ (string): rBTC
Arg [2] : decimals_ (uint8): 18
Arg [3] : initTotalSupply_ (uint256): 100000000000000
Arg [4] : implementation_ (address): 0xfF43c3067F926872B072a33457d3DB45A2134D9F
Arg [5] : becomeImplementationData (bytes): 0x
-----Encoded View---------------
11 Constructor Arguments found :
Arg [0] : 00000000000000000000000000000000000000000000000000000000000000c0
Arg [1] : 0000000000000000000000000000000000000000000000000000000000000100
Arg [2] : 0000000000000000000000000000000000000000000000000000000000000012
Arg [3] : 00000000000000000000000000000000000000000000000000005af3107a4000
Arg [4] : 000000000000000000000000ff43c3067f926872b072a33457d3db45a2134d9f
Arg [5] : 0000000000000000000000000000000000000000000000000000000000000140
Arg [6] : 000000000000000000000000000000000000000000000000000000000000000d
Arg [7] : 526963655175616e742042544300000000000000000000000000000000000000
Arg [8] : 0000000000000000000000000000000000000000000000000000000000000004
Arg [9] : 7242544300000000000000000000000000000000000000000000000000000000
Arg [10] : 0000000000000000000000000000000000000000000000000000000000000000
Loading...
Loading
[ Download: CSV Export ]
[ Download: CSV Export ]
A token is a representation of an on-chain or off-chain asset. The token page shows information such as price, total supply, holders, transfers and social links. Learn more about this page in our Knowledge Base.
Add Token to MetaMask (Web3)