Address Contract Partially Verified
Address
0xB8BAa0e4287890a5F79863aB62b7F175ceCbD433
Balance
0 ETH
Nonce
1
Code Size
3641 bytes
Creator
0xA6dF4fcB...ff84 at tx 0xc85f1e1e...a52d7e
Indexed Transactions
0
Contract Bytecode
3641 bytes
0x600436101561000d57610e33565b600035601c52740100000000000000000000000000000000000000006020526f7fffffffffffffffffffffffffffffff6040527fffffffffffffffffffffffffffffffff8000000000000000000000000000000060605274012a05f1fffffffffffffffffffffffffdabf41c006080527ffffffffffffffffffffffffed5fa0e000000000000000000000000000000000060a0526000156101fd575b61014052600a5461016052600b5461018052600880546001606051818301806040519013156100d757600080fd5b80919012156100e557600080fd5b90509050815550600980546212750081818301101561010357600080fd5b80820190509050815550600854151561012857676741e1ac8515c30c610160526101ad565b61018080516101605162127500808202821582848304141761014957600080fd5b8090509050905081818301101561015f57600080fd5b80820190509050815250601b6008541215610186576703f8b0107b45c294610160526101ac565b609d60085412151561019d576000610160526101ab565b670152e55ad3c1eb86610160525b5b5b61018051600b5561016051600a55426101a052610160516101c052610180516101e0527f27e46362a1e6129b6dd539c984ce739291a97128dfcaeca1255e8ac83abd944160606101a0a161014051565b63d43b40fa600051141561024d57341561021657600080fd5b6009546212750081818301101561022c57600080fd5b8082019050905042101561023f57600080fd5b600658016100a9565b600050005b63adc4cf4360005114156102c857341561026657600080fd5b60095461014052610140516212750081818301101561028457600080fd5b80820190509050421015156102b85761014051600658016100a9565b6101405260005060095460005260206000f3506102c6565b6101405160005260206000f3505b005b63b26b238e60005114156103775734156102e157600080fd5b6009546101405261014051621275008181830110156102ff57600080fd5b808201905090504210151561034d5761014051600658016100a9565b610140526000506009546212750081818301101561033857600080fd5b8082019050905060005260206000f350610375565b610140516212750081818301101561036457600080fd5b8082019050905060005260206000f3505b005b6000156103e0575b61014052600b54426009548082101561039757600080fd5b80820390509050600a5480820282158284830414176103b557600080fd5b809050905090508181830110156103cb57600080fd5b80820190509050600052600051610140515650005b6324f92a2560005114156104155734156103f957600080fd5b6006580161037f565b610140526101405160005260206000f350005b631652e9fc600051141561049157341561042e57600080fd5b600435602051811061043f57600080fd5b50600754331461044e57600080fd5b6006541561045b57600080fd5b600435600655600435610140527fcec52196e972044edde8689a1b608e459c5946b7f3e5c8cd3d6d8e126d422e1c6020610140a1005b63e9333fab60005114156105005734156104aa57600080fd5b60043560205181106104bb57600080fd5b5060075433146104ca57600080fd5b600435600755600435610140527f5a272403b402d892977df56625f4164ccaf70ca3863991c43ecfe76a6905b0a16020610140a1005b6318160ddd600051141561052757341561051957600080fd5b60055460005260206000f350005b63dd62ed3e600051141561058e57341561054057600080fd5b600435602051811061055157600080fd5b50602435602051811061056357600080fd5b50600460043560e05260c052604060c02060243560e05260c052604060c0205460005260206000f350005b63a9059cbb600051141561065f5734156105a757600080fd5b60043560205181106105b857600080fd5b506000600435186105c857600080fd5b60033360e05260c052604060c0208054602435808210156105e857600080fd5b80820390509050815550600360043560e05260c052604060c020805460243581818301101561061657600080fd5b8082019050905081555060243561014052600435337fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef6020610140a3600160005260206000f350005b6323b872dd600051141561077e57341561067857600080fd5b600435602051811061068957600080fd5b50602435602051811061069b57600080fd5b506000602435186106ab57600080fd5b600360043560e05260c052604060c0208054604435808210156106cd57600080fd5b80820390509050815550600360243560e05260c052604060c02080546044358181830110156106fb57600080fd5b80820190509050815550600460043560e05260c052604060c0203360e05260c052604060c02080546044358082101561073357600080fd5b80820390509050815550604435610140526024356004357fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef6020610140a3600160005260206000f350005b63095ea7b3600051141561084157341561079757600080fd5b60043560205181106107a857600080fd5b5060243515156107b95760016107d8565b60043360e05260c052604060c02060043560e05260c052604060c02054155b5b6107e257600080fd5b60243560043360e05260c052604060c02060043560e05260c052604060c0205560243561014052600435337f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9256020610140a3600160005260206000f350005b6340c10f19600051141561097857341561085a57600080fd5b600435602051811061086b57600080fd5b50600654331461087a57600080fd5b60006004351861088957600080fd5b6009546212750081818301101561089f57600080fd5b80820190509050421015156108bb57600658016100a9565b6000505b6005546024358181830110156108d057600080fd5b8082019050905061014052610140516006580161037f565b61018052610140526101805161014051111561090357600080fd5b61014051600555600360043560e05260c052604060c020805460243581818301101561092e57600080fd5b808201905090508155506024356101a05260043560007fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef60206101a0a3600160005260206000f350005b6342966c686000511415610a1757341561099157600080fd5b60033360e05260c052604060c0208054600435808210156109b157600080fd5b8082039050905081555060058054600435808210156109cf57600080fd5b80820390509050815550600435610140526000337fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef6020610140a3600160005260206000f350005b63e1430e066000511415610b99573415610a3057600080fd5b6060600435600401610140376040600435600401351115610a5057600080fd5b60406024356004016101c0376020602435600401351115610a7057600080fd5b6308c379a0610220526020610240526024610260527f4f6e6c792061646d696e20697320616c6c6f77656420746f206368616e676520610280527f6e616d65000000000000000000000000000000000000000000000000000000006102a052610260506007543314610ae357608461023cfd5b61014080600060c052602060c020602082510161012060006003818352015b82610120516020021115610b1557610b37565b61012051602002850151610120518501555b8151600101808352811415610b02575b5050505050506101c080600160c052602060c020602082510161012060006002818352015b82610120516020021115610b6f57610b91565b61012051602002850151610120518501555b8151600101808352811415610b5c575b505050505050005b6306fdde036000511415610c4d573415610bb257600080fd5b60008060c052602060c020610180602082540161012060006003818352015b82610120516020021115610be457610c06565b61012051850154610120516020028501525b8151600101808352811415610bd1575b50505050505061018051806101a001818260206001820306601f82010390500336823750506020610160526040610180510160206001820306601f8201039050610160f350005b6395d89b416000511415610d01573415610c6657600080fd5b60018060c052602060c020610180602082540161012060006002818352015b82610120516020021115610c9857610cba565b61012051850154610120516020028501525b8151600101808352811415610c85575b50505050505061018051806101a001818260206001820306601f82010390500336823750506020610160526040610180510160206001820306601f8201039050610160f350005b63313ce5676000511415610d28573415610d1a57600080fd5b60025460005260206000f350005b6370a082316000511415610d6f573415610d4157600080fd5b6004356020518110610d5257600080fd5b50600360043560e05260c052604060c0205460005260206000f350005b63075461726000511415610d96573415610d8857600080fd5b60065460005260206000f350005b63f851a4406000511415610dbd573415610daf57600080fd5b60075460005260206000f350005b63f9a40bf66000511415610de4573415610dd657600080fd5b60085460005260206000f350005b637375be266000511415610e0b573415610dfd57600080fd5b60095460005260206000f350005b632c4e722e6000511415610e32573415610e2457600080fd5b600a5460005260206000f350005b5b60006000fd
Verified Source Code Partial Match
Compiler: v0.2.4+commit.7949850
Vyper_contract.vy 336 lines
# @version 0.2.4
"""
@title Curve DAO Token
@author Curve Finance
@license MIT
@notice ERC20 with piecewise-linear mining supply.
@dev Based on the ERC-20 token standard as defined at
https://eips.ethereum.org/EIPS/eip-20
"""
from vyper.interfaces import ERC20
implements: ERC20
event Transfer:
_from: indexed(address)
_to: indexed(address)
_value: uint256
event Approval:
_owner: indexed(address)
_spender: indexed(address)
_value: uint256
event UpdateMiningParameters:
time: uint256
rate: uint256
supply: uint256
event SetMinter:
minter: address
event SetAdmin:
admin: address
name: public(String[64])
symbol: public(String[32])
decimals: public(uint256)
balanceOf: public(HashMap[address, uint256])
allowances: HashMap[address, HashMap[address, uint256]]
total_supply: uint256
minter: public(address)
admin: public(address)
# General constants
HOUR: constant(uint256) = 3600
DAY: constant(uint256) = 86400
WEEK: constant(uint256) = 86400 * 7
YEAR: constant(uint256) = WEEK * 52
# Allocation:
# ===========
# WE GIVE IT BACK TO YOU ... THE PEOPLE: 100%
# Supply parameters
INITIAL_SUPPLY: constant(uint256) = 0
INFLATION_DELAY: constant(uint256) = 3 * HOUR # Three Hour delay before minting may begin
RATE_DENOMINATOR: constant(uint256) = 10 ** 18
RATE_TIME: constant(uint256) = 2 * WEEK # How often the rate goes to the next epoch
INITIAL_RATE: constant(uint256) = 9_000_000 * 10 ** 18 / (2 * WEEK) # 9 million for the first 2 weeks
EPOCH_INITIAL_RATE: constant(uint256) = 9_000_000 * 10 ** 18 / YEAR # 9 million for the first year thereafter
LATE_RATE: constant(uint256) = 3_000_000 * 10 ** 18 / YEAR # 3 million per year after
INITIAL_RATE_EPOCH_CUTTOF: constant(uint256) = 27 # After 52 Weeks use the late rate
FINAL_INFLATION_EPOCH: constant(uint256) = 157 # No more inflation after 6 years (0 epoch is the 2 week period)
# Supply variables
mining_epoch: public(int128)
start_epoch_time: public(uint256)
rate: public(uint256)
start_epoch_supply: uint256
@external
def __init__(_name: String[64], _symbol: String[32], _decimals: uint256):
"""
@notice Contract constructor
@param _name Token full name
@param _symbol Token symbol
@param _decimals Number of decimals for token
"""
init_supply: uint256 = INITIAL_SUPPLY * 10 ** _decimals
self.name = _name
self.symbol = _symbol
self.decimals = _decimals
self.balanceOf[msg.sender] = init_supply
self.total_supply = init_supply
self.admin = msg.sender
log Transfer(ZERO_ADDRESS, msg.sender, init_supply)
self.start_epoch_time = block.timestamp + INFLATION_DELAY - RATE_TIME
self.mining_epoch = -1
self.rate = 0
self.start_epoch_supply = init_supply
@internal
def _update_mining_parameters():
"""
@dev Update mining rate and supply at the start of the epoch
Any modifying mining call must also call this
"""
_rate: uint256 = self.rate
_start_epoch_supply: uint256 = self.start_epoch_supply
self.mining_epoch += 1
self.start_epoch_time += RATE_TIME
if self.mining_epoch == 0:
_rate = INITIAL_RATE
else:
_start_epoch_supply += _rate * RATE_TIME
if self.mining_epoch < INITIAL_RATE_EPOCH_CUTTOF:
_rate = EPOCH_INITIAL_RATE
elif self.mining_epoch >= FINAL_INFLATION_EPOCH:
_rate = 0
else:
_rate = LATE_RATE
self.start_epoch_supply = _start_epoch_supply
self.rate = _rate
log UpdateMiningParameters(block.timestamp, _rate, _start_epoch_supply)
@external
def update_mining_parameters():
"""
@notice Update mining rate and supply at the start of the epoch
@dev Callable by any address, but only once per epoch
Total supply becomes slightly larger if this function is called late
"""
assert block.timestamp >= self.start_epoch_time + RATE_TIME # dev: too soon!
self._update_mining_parameters()
@external
def start_epoch_time_write() -> uint256:
"""
@notice Get timestamp of the current mining epoch start
while simultaneously updating mining parameters
@return Timestamp of the epoch
"""
_start_epoch_time: uint256 = self.start_epoch_time
if block.timestamp >= _start_epoch_time + RATE_TIME:
self._update_mining_parameters()
return self.start_epoch_time
else:
return _start_epoch_time
@external
def future_epoch_time_write() -> uint256:
"""
@notice Get timestamp of the next mining epoch start
while simultaneously updating mining parameters
@return Timestamp of the next epoch
"""
_start_epoch_time: uint256 = self.start_epoch_time
if block.timestamp >= _start_epoch_time + RATE_TIME:
self._update_mining_parameters()
return self.start_epoch_time + RATE_TIME
else:
return _start_epoch_time + RATE_TIME
@internal
@view
def _available_supply() -> uint256:
return self.start_epoch_supply + (block.timestamp - self.start_epoch_time) * self.rate
@external
@view
def available_supply() -> uint256:
"""
@notice Current number of tokens in existence (claimed or unclaimed)
"""
return self._available_supply()
@external
def set_minter(_minter: address):
"""
@notice Set the minter address
@dev Only callable once, when minter has not yet been set
@param _minter Address of the minter
"""
assert msg.sender == self.admin # dev: admin only
assert self.minter == ZERO_ADDRESS # dev: can set the minter only once, at creation
self.minter = _minter
log SetMinter(_minter)
@external
def set_admin(_admin: address):
"""
@notice Set the new admin.
@dev After all is set up, admin only can change the token name
@param _admin New admin address
"""
assert msg.sender == self.admin # dev: admin only
self.admin = _admin
log SetAdmin(_admin)
@external
@view
def totalSupply() -> uint256:
"""
@notice Total number of tokens in existence.
"""
return self.total_supply
@external
@view
def allowance(_owner : address, _spender : address) -> uint256:
"""
@notice Check the amount of tokens that an owner allowed to a spender
@param _owner The address which owns the funds
@param _spender The address which will spend the funds
@return uint256 specifying the amount of tokens still available for the spender
"""
return self.allowances[_owner][_spender]
@external
def transfer(_to : address, _value : uint256) -> bool:
"""
@notice Transfer `_value` tokens from `msg.sender` to `_to`
@dev Vyper does not allow underflows, so the subtraction in
this function will revert on an insufficient balance
@param _to The address to transfer to
@param _value The amount to be transferred
@return bool success
"""
assert _to != ZERO_ADDRESS # dev: transfers to 0x0 are not allowed
self.balanceOf[msg.sender] -= _value
self.balanceOf[_to] += _value
log Transfer(msg.sender, _to, _value)
return True
@external
def transferFrom(_from : address, _to : address, _value : uint256) -> bool:
"""
@notice Transfer `_value` tokens from `_from` to `_to`
@param _from address The address which you want to send tokens from
@param _to address The address which you want to transfer to
@param _value uint256 the amount of tokens to be transferred
@return bool success
"""
assert _to != ZERO_ADDRESS # dev: transfers to 0x0 are not allowed
# NOTE: vyper does not allow underflows
# so the following subtraction would revert on insufficient balance
self.balanceOf[_from] -= _value
self.balanceOf[_to] += _value
self.allowances[_from][msg.sender] -= _value
log Transfer(_from, _to, _value)
return True
@external
def approve(_spender : address, _value : uint256) -> bool:
"""
@notice Approve `_spender` to transfer `_value` tokens on behalf of `msg.sender`
@dev Approval may only be from zero -> nonzero or from nonzero -> zero in order
to mitigate the potential race condition described here:
https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
@param _spender The address which will spend the funds
@param _value The amount of tokens to be spent
@return bool success
"""
assert _value == 0 or self.allowances[msg.sender][_spender] == 0
self.allowances[msg.sender][_spender] = _value
log Approval(msg.sender, _spender, _value)
return True
@external
def mint(_to: address, _value: uint256) -> bool:
"""
@notice Mint `_value` tokens and assign them to `_to`
@dev Emits a Transfer event originating from 0x00
@param _to The account that will receive the created tokens
@param _value The amount that will be created
@return bool success
"""
assert msg.sender == self.minter # dev: minter only
assert _to != ZERO_ADDRESS # dev: zero address
if block.timestamp >= self.start_epoch_time + RATE_TIME:
self._update_mining_parameters()
_total_supply: uint256 = self.total_supply + _value
assert _total_supply <= self._available_supply() # dev: exceeds allowable mint amount
self.total_supply = _total_supply
self.balanceOf[_to] += _value
log Transfer(ZERO_ADDRESS, _to, _value)
return True
@external
def burn(_value: uint256) -> bool:
"""
@notice Burn `_value` tokens belonging to `msg.sender`
@dev Emits a Transfer event with a destination of 0x00
@param _value The amount that will be burned
@return bool success
"""
self.balanceOf[msg.sender] -= _value
self.total_supply -= _value
log Transfer(msg.sender, ZERO_ADDRESS, _value)
return True
@external
def set_name(_name: String[64], _symbol: String[32]):
"""
@notice Change the token name and symbol to `_name` and `_symbol`
@dev Only callable by the admin account
@param _name New token name
@param _symbol New token symbol
"""
assert msg.sender == self.admin, "Only admin is allowed to change name"
self.name = _name
self.symbol = _symbol
Read Contract
admin 0xf851a440 → address
allowance 0xdd62ed3e → uint256
available_supply 0x24f92a25 → uint256
balanceOf 0x70a08231 → uint256
decimals 0x313ce567 → uint256
mining_epoch 0xf9a40bf6 → int128
minter 0x07546172 → address
name 0x06fdde03 → string
rate 0x2c4e722e → uint256
start_epoch_time 0x7375be26 → uint256
symbol 0x95d89b41 → string
totalSupply 0x18160ddd → uint256
Write Contract 11 functions
These functions modify contract state and require a wallet transaction to execute.
approve 0x095ea7b3
address _spender
uint256 _value
returns: bool
burn 0x42966c68
uint256 _value
returns: bool
future_epoch_time_write 0xb26b238e
No parameters
returns: uint256
mint 0x40c10f19
address _to
uint256 _value
returns: bool
set_admin 0xe9333fab
address _admin
set_minter 0x1652e9fc
address _minter
set_name 0xe1430e06
string _name
string _symbol
start_epoch_time_write 0xadc4cf43
No parameters
returns: uint256
transfer 0xa9059cbb
address _to
uint256 _value
returns: bool
transferFrom 0x23b872dd
address _from
address _to
uint256 _value
returns: bool
update_mining_parameters 0xd43b40fa
No parameters
Token Balances (1)
View Transfers →Recent Transactions
No transactions found for this address