Latest 25 from a total of 924 transactions
Transaction Hash |
Method
|
Block
|
From
|
To
|
|||||
---|---|---|---|---|---|---|---|---|---|
Approve | 21478725 | 19 hrs ago | IN | 0 ETH | 0.00023898 | ||||
Approve | 21464946 | 2 days ago | IN | 0 ETH | 0.00031113 | ||||
Transfer | 21423738 | 8 days ago | IN | 0 ETH | 0.00148809 | ||||
Transfer | 21392027 | 12 days ago | IN | 0 ETH | 0.00037238 | ||||
Approve | 21363485 | 16 days ago | IN | 0 ETH | 0.00048551 | ||||
Transfer | 21360581 | 17 days ago | IN | 0 ETH | 0.00052826 | ||||
Transfer | 21356987 | 17 days ago | IN | 0 ETH | 0.000463 | ||||
Transfer | 21356964 | 17 days ago | IN | 0 ETH | 0.00045032 | ||||
Transfer | 21340678 | 20 days ago | IN | 0 ETH | 0.00089806 | ||||
Approve | 21336623 | 20 days ago | IN | 0 ETH | 0.00116841 | ||||
Transfer | 21336423 | 20 days ago | IN | 0 ETH | 0.00102669 | ||||
Approve | 21331876 | 21 days ago | IN | 0 ETH | 0.00145984 | ||||
Approve | 21331111 | 21 days ago | IN | 0 ETH | 0.00115325 | ||||
Transfer | 21327800 | 21 days ago | IN | 0 ETH | 0.00090511 | ||||
Approve | 21312613 | 24 days ago | IN | 0 ETH | 0.00060848 | ||||
Approve | 21311419 | 24 days ago | IN | 0 ETH | 0.00070895 | ||||
Transfer | 21311364 | 24 days ago | IN | 0 ETH | 0.00072079 | ||||
Approve | 21303342 | 25 days ago | IN | 0 ETH | 0.00061778 | ||||
Approve | 21286260 | 27 days ago | IN | 0 ETH | 0.00042628 | ||||
Approve | 21281762 | 28 days ago | IN | 0 ETH | 0.00052451 | ||||
Approve | 21280401 | 28 days ago | IN | 0 ETH | 0.00155154 | ||||
Approve | 21269162 | 30 days ago | IN | 0 ETH | 0.00020567 | ||||
Approve | 21269161 | 30 days ago | IN | 0 ETH | 0.00039018 | ||||
Approve | 21261726 | 31 days ago | IN | 0 ETH | 0.00038758 | ||||
Approve | 21257170 | 31 days ago | IN | 0 ETH | 0.00043835 |
View more zero value Internal Transactions in Advanced View mode
Advanced mode:
Loading...
Loading
Similar Match Source Code This contract matches the deployed Bytecode of the Source Code for Contract 0x7d2153fa...021b94B8F The constructor portion of the code might be different and could alter the actual behaviour of the contract
Contract Name:
Vyper_contract
Compiler Version
vyper:0.3.3
Contract Source Code (Vyper language format)
# @version 0.3.3 """ @title BAO 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[32]) symbol: public(String[32]) decimals: public(uint8) balanceOf: public(HashMap[address, uint256]) allowance: public(HashMap[address, HashMap[address, uint256]]) totalSupply: public(uint256) minter: public(address) admin: public(address) # General constants YEAR: constant(uint256) = 86400 * 365 # Allocation: # ========= # * BAO unlocking and migration (Main-net supply + xDAI supply after farms end) # == X% == # supply left for inflation: Y% || **(X + Y = 100%)** # Supply parameters INITIAL_SUPPLY_CAP: constant(uint256) = 1_091_753_221 # locked supply + circulating at farm ending 1,091,753,220.323429093032914451 INITIAL_RATE: constant(uint256) = 230_255_942 * 10 ** 18 / YEAR # ~42% premine RATE_REDUCTION_TIME: constant(uint256) = YEAR RATE_REDUCTION_COEFFICIENT: constant(uint256) = 1189207115002721024 #2 ** (1/4) * 1e18 RATE_DENOMINATOR: constant(uint256) = 10 ** 18 INFLATION_DELAY: constant(uint256) = 86400 # Supply variables mining_epoch: public(int128) start_epoch_time: public(uint256) rate: public(uint256) start_epoch_supply: uint256 @external def __init__(_name: String[32], _symbol: String[32], _decimals: uint8): """ @notice Contract constructor @param _name Token full name @param _symbol Token symbol @param _decimals Number of decimals for token """ init_supply: uint256 = INITIAL_SUPPLY_CAP * 10 ** convert(_decimals, uint256) self.name = _name self.symbol = _symbol self.decimals = _decimals self.balanceOf[msg.sender] = init_supply self.totalSupply = init_supply self.admin = msg.sender log Transfer(ZERO_ADDRESS, msg.sender, init_supply) self.start_epoch_time = block.timestamp + INFLATION_DELAY - RATE_REDUCTION_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.start_epoch_time += RATE_REDUCTION_TIME self.mining_epoch += 1 if _rate == 0: _rate = INITIAL_RATE else: _start_epoch_supply += _rate * RATE_REDUCTION_TIME self.start_epoch_supply = _start_epoch_supply _rate = _rate * RATE_DENOMINATOR / RATE_REDUCTION_COEFFICIENT 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_REDUCTION_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_REDUCTION_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_REDUCTION_TIME: self._update_mining_parameters() return self.start_epoch_time + RATE_REDUCTION_TIME else: return _start_epoch_time + RATE_REDUCTION_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 @view def mintable_in_timeframe(start: uint256, end: uint256) -> uint256: """ @notice How much supply is mintable from start timestamp till end timestamp @param start Start of the time interval (timestamp) @param end End of the time interval (timestamp) @return Tokens mintable from `start` till `end` """ assert start <= end # dev: start > end to_mint: uint256 = 0 current_epoch_time: uint256 = self.start_epoch_time current_rate: uint256 = self.rate # Special case if end is in future (not yet minted) epoch if end > current_epoch_time + RATE_REDUCTION_TIME: current_epoch_time += RATE_REDUCTION_TIME current_rate = current_rate * RATE_DENOMINATOR / RATE_REDUCTION_COEFFICIENT assert end <= current_epoch_time + RATE_REDUCTION_TIME # dev: too far in future for i in range(999): # will not work in 1000 years. Darn! if end >= current_epoch_time: current_end: uint256 = end if current_end > current_epoch_time + RATE_REDUCTION_TIME: current_end = current_epoch_time + RATE_REDUCTION_TIME current_start: uint256 = start if current_start >= current_epoch_time + RATE_REDUCTION_TIME: break # We should never get here but what if... elif current_start < current_epoch_time: current_start = current_epoch_time to_mint += current_rate * (current_end - current_start) if start >= current_epoch_time: break current_epoch_time -= RATE_REDUCTION_TIME current_rate = current_rate * RATE_REDUCTION_COEFFICIENT / RATE_DENOMINATOR # double-division with rounding made rate a bit less => good assert current_rate <= INITIAL_RATE # This should never happen return to_mint @external def set_minter(_minter: address): """ @notice Set the minter address @dev Only callable once, when the minter contract 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 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.allowance[_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.allowance[msg.sender][_spender] == 0 self.allowance[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_REDUCTION_TIME: self._update_mining_parameters() _total_supply: uint256 = self.totalSupply + _value assert _total_supply <= self._available_supply() # dev: exceeds allowable mint amount self.totalSupply = _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.totalSupply -= _value self.balanceOf[msg.sender] -= _value log Transfer(msg.sender, ZERO_ADDRESS, _value) return True
Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
[{"name":"Transfer","inputs":[{"name":"_from","type":"address","indexed":true},{"name":"_to","type":"address","indexed":true},{"name":"_value","type":"uint256","indexed":false}],"anonymous":false,"type":"event"},{"name":"Approval","inputs":[{"name":"_owner","type":"address","indexed":true},{"name":"_spender","type":"address","indexed":true},{"name":"_value","type":"uint256","indexed":false}],"anonymous":false,"type":"event"},{"name":"UpdateMiningParameters","inputs":[{"name":"time","type":"uint256","indexed":false},{"name":"rate","type":"uint256","indexed":false},{"name":"supply","type":"uint256","indexed":false}],"anonymous":false,"type":"event"},{"name":"SetMinter","inputs":[{"name":"minter","type":"address","indexed":false}],"anonymous":false,"type":"event"},{"name":"SetAdmin","inputs":[{"name":"admin","type":"address","indexed":false}],"anonymous":false,"type":"event"},{"stateMutability":"nonpayable","type":"constructor","inputs":[{"name":"_name","type":"string"},{"name":"_symbol","type":"string"},{"name":"_decimals","type":"uint8"}],"outputs":[]},{"stateMutability":"nonpayable","type":"function","name":"update_mining_parameters","inputs":[],"outputs":[]},{"stateMutability":"nonpayable","type":"function","name":"start_epoch_time_write","inputs":[],"outputs":[{"name":"","type":"uint256"}]},{"stateMutability":"nonpayable","type":"function","name":"future_epoch_time_write","inputs":[],"outputs":[{"name":"","type":"uint256"}]},{"stateMutability":"view","type":"function","name":"available_supply","inputs":[],"outputs":[{"name":"","type":"uint256"}]},{"stateMutability":"view","type":"function","name":"mintable_in_timeframe","inputs":[{"name":"start","type":"uint256"},{"name":"end","type":"uint256"}],"outputs":[{"name":"","type":"uint256"}]},{"stateMutability":"nonpayable","type":"function","name":"set_minter","inputs":[{"name":"_minter","type":"address"}],"outputs":[]},{"stateMutability":"nonpayable","type":"function","name":"set_admin","inputs":[{"name":"_admin","type":"address"}],"outputs":[]},{"stateMutability":"nonpayable","type":"function","name":"transfer","inputs":[{"name":"_to","type":"address"},{"name":"_value","type":"uint256"}],"outputs":[{"name":"","type":"bool"}]},{"stateMutability":"nonpayable","type":"function","name":"transferFrom","inputs":[{"name":"_from","type":"address"},{"name":"_to","type":"address"},{"name":"_value","type":"uint256"}],"outputs":[{"name":"","type":"bool"}]},{"stateMutability":"nonpayable","type":"function","name":"approve","inputs":[{"name":"_spender","type":"address"},{"name":"_value","type":"uint256"}],"outputs":[{"name":"","type":"bool"}]},{"stateMutability":"nonpayable","type":"function","name":"mint","inputs":[{"name":"_to","type":"address"},{"name":"_value","type":"uint256"}],"outputs":[{"name":"","type":"bool"}]},{"stateMutability":"nonpayable","type":"function","name":"burn","inputs":[{"name":"_value","type":"uint256"}],"outputs":[{"name":"","type":"bool"}]},{"stateMutability":"view","type":"function","name":"name","inputs":[],"outputs":[{"name":"","type":"string"}]},{"stateMutability":"view","type":"function","name":"symbol","inputs":[],"outputs":[{"name":"","type":"string"}]},{"stateMutability":"view","type":"function","name":"decimals","inputs":[],"outputs":[{"name":"","type":"uint8"}]},{"stateMutability":"view","type":"function","name":"balanceOf","inputs":[{"name":"arg0","type":"address"}],"outputs":[{"name":"","type":"uint256"}]},{"stateMutability":"view","type":"function","name":"allowance","inputs":[{"name":"arg0","type":"address"},{"name":"arg1","type":"address"}],"outputs":[{"name":"","type":"uint256"}]},{"stateMutability":"view","type":"function","name":"totalSupply","inputs":[],"outputs":[{"name":"","type":"uint256"}]},{"stateMutability":"view","type":"function","name":"minter","inputs":[],"outputs":[{"name":"","type":"address"}]},{"stateMutability":"view","type":"function","name":"admin","inputs":[],"outputs":[{"name":"","type":"address"}]},{"stateMutability":"view","type":"function","name":"mining_epoch","inputs":[],"outputs":[{"name":"","type":"int128"}]},{"stateMutability":"view","type":"function","name":"start_epoch_time","inputs":[],"outputs":[{"name":"","type":"uint256"}]},{"stateMutability":"view","type":"function","name":"rate","inputs":[],"outputs":[{"name":"","type":"uint256"}]}]
Deployed Bytecode
0x600436101561000d57610991565b60003560e01c34610adb5763d43b40fa811861004b57600b546301e133808181830110610adb57808201905090504210610adb57610049610997565b005b63adc4cf4381186100a357600b5460e05260e0516301e133808181830110610adb578082019050905042101561008857602060e06100a1566100a1565b610090610997565b600b546101005260206101006100a1565bf35b63b26b238e811861012d57600b5460e05260e0516301e133808181830110610adb57808201905090504210156100fd5760e0516301e133808181830110610adb578082019050905061010052602061010061012b5661012b565b610105610997565b600b546301e133808181830110610adb578082019050905061010052602061010061012b565bf35b6324f92a2581186101485760206101446040610a9a565b6040f35b63d725a9ca811861035b5760243560043511610adb576000604052600b54606052600c546080526060516301e133808181830110610adb578082019050905060243511156101df576060516301e133808181830110610adb5780820190509050606052608051670de0b6b3a7640000808202821582848304141715610adb5790509050671080e992061ab300808204905090506080525b6060516301e133808181830110610adb578082019050905060243511610adb5760006103e7905b8060a052606051602435106102eb5760243560c0526060516301e133808181830110610adb578082019050905060c0511115610258576060516301e133808181830110610adb578082019050905060c0525b60043560e0526060516301e133808181830110610adb578082019050905060e05110156103535760605160e051101561029a5760605160e05261029a56610353565b60405160805160c05160e051808210610adb5780820390509050808202821582848304141715610adb57905090508181830110610adb5780820190509050604052606051600435106102eb57610353565b6060516301e13380808210610adb5780820390509050606052608051671080e992061ab300808202821582848304141715610adb5790509050670de0b6b3a764000080820490509050608052676553ab888bb8f9f360805111610adb57600101818118610206575b505060206040f35b631652e9fc81186103b8576004358060a01c610adb576040526009543318610adb57600854610adb576040516008557fcec52196e972044edde8689a1b608e459c5946b7f3e5c8cd3d6d8e126d422e1c60405160605260206060a1005b63e9333fab811861040e576004358060a01c610adb576040526009543318610adb576040516009557f5a272403b402d892977df56625f4164ccaf70ca3863991c43ecfe76a6905b0a160405160605260206060a1005b63a9059cbb81186104b8576004358060a01c610adb57604052600060405114610adb5760053360205260005260406000208054602435808210610adb57808203905090508155506005604051602052600052604060002080546024358181830110610adb5780820190509050815550604051337fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef60243560605260206060a3600160605260206060f35b6323b872dd81186105a9576004358060a01c610adb576040526024358060a01c610adb57606052600060605114610adb57600560405160205260005260406000208054604435808210610adb57808203905090508155506005606051602052600052604060002080546044358181830110610adb5780820190509050815550600660405160205260005260406000208033602052600052604060002090508054604435808210610adb57808203905090508155506060516040517fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef60443560805260206080a3600160805260206080f35b63095ea7b38118610656576004358060a01c610adb57604052602435156105f0576006336020526000526040600020806040516020526000526040600020905054156105f3565b60015b15610adb576024356006336020526000526040600020806040516020526000526040600020905055604051337f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92560243560605260206060a3600160605260206060f35b6340c10f198118610749576004358060a01c610adb5760e0526008543318610adb57600060e05114610adb57600b546301e133808181830110610adb578082019050905042106106a8576106a8610997565b6007546024358181830110610adb5780820190509050610100526106cd610120610a9a565b610120516101005111610adb5761010051600755600560e051602052600052604060002080546024358181830110610adb578082019050905081555060e05160007fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef602435610120526020610120a36001610120526020610120f35b6342966c6881186107c957600754600435808210610adb578082039050905060075560053360205260005260406000208054600435808210610adb57808203905090508155506000337fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef60043560405260206040a3600160405260206040f35b6306fdde03811861081957602080604052806040016000548082526020820160015481525050805180602083010181600003601f163682375050601f19601f825160200101169050810190506040f35b6395d89b41811861086957602080604052806040016002548082526020820160035481525050805180602083010181600003601f163682375050601f19601f825160200101169050810190506040f35b63313ce56781186108805760045460405260206040f35b6370a0823181186108b3576004358060a01c610adb57604052600560405160205260005260406000205460605260206060f35b63dd62ed3e8118610905576004358060a01c610adb576040526024358060a01c610adb576060526006604051602052600052604060002080606051602052600052604060002090505460805260206080f35b6318160ddd811861091c5760075460405260206040f35b630754617281186109335760085460405260206040f35b63f851a440811861094a5760095460405260206040f35b63f9a40bf6811861096157600a5460405260206040f35b637375be26811861097857600b5460405260206040f35b632c4e722e811861098f57600c5460405260206040f35b505b60006000fd5b600c54604052600d54606052600b546301e133808181830110610adb5780820190509050600b55600a54600180820180600f0b8118610adb5790509050600a5560405115610a4f576060516040516301e13380808202821582848304141715610adb57905090508181830110610adb5780820190509050606052606051600d55604051670de0b6b3a7640000808202821582848304141715610adb5790509050671080e992061ab30080820490509050604052610a5c565b676553ab888bb8f9f36040525b604051600c557f27e46362a1e6129b6dd539c984ce739291a97128dfcaeca1255e8ac83abd94414260805260405160a05260605160c05260606080a1565b600d5442600b54808210610adb5780820390509050600c54808202821582848304141715610adb57905090508181830110610adb5780820190509050815250565b600080fd
Loading...
Loading
Loading...
Loading
OVERVIEW
Bao is grassroots, decentralization maximalist, community-run and community funded.Multichain Portfolio | 30 Chains
Chain | Token | Portfolio % | Price | Amount | Value |
---|---|---|---|---|---|
ETH | 100.00% | $0.998244 | 17.1463 | $17.12 |
Loading...
Loading
[ Download: CSV Export ]
A contract address hosts a smart contract, which is a set of code stored on the blockchain that runs when predetermined conditions are met. Learn more about addresses in our Knowledge Base.