Contract 0xb1A76e5454E4aF0C4F8f7b071df14a3B4011e8AF 3

 
Txn Hash Method
Block
From
To
Value [Txn Fee]
0x655b303c04ccf3e6acb5d7966f27ef9dc2c4d49db0e2eaf52cc0d840a25c6a8a0x6040610479594792022-03-15 22:04:17198 days 19 hrs ago0x8286dc6df929c4bfa4f6951cab4dae2ec02d4d72 IN  Create: Vyper_contract0 ETH0.001668379124 ETH
[ Download CSV Export 
Parent Txn Hash Block From To Value
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
Vyper_contract

Compiler Version
vyper:0.2.15

Optimization Enabled:
N/A

Other Settings:
, MIT license

Contract Source Code (Vyper language format)

# @version 0.2.15
"""
@title HND DAO Token proxy
@author Hundred Finanace
@license MIT
@notice configurable 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


event SetAdmin:
    admin: address

admin: public(address)

first_epoch_time: public(uint256)

epoch_length: public(uint256)

rewards: public(uint256[100000000000000000000000000000])


@external
def __init__(_epoch_length: uint256, _admin: address):
    """
    @notice Contract constructor
    """
    self.admin = _admin

    self.epoch_length = _epoch_length
    self.first_epoch_time = block.timestamp / _epoch_length * _epoch_length - _epoch_length


@internal
@view
def _epoch_at(_timestamp: uint256) -> uint256:
    """
    @notice gives epoch number for a given time (0 for first epoch)
    @return uint256 epoch number
    """
    if _timestamp < self.first_epoch_time:
        return 0

    return (_timestamp - self.first_epoch_time) / self.epoch_length


@internal
@view
def _current_epoch() -> uint256:
    """
    @notice gives current reward epoch number (0 for first epoch)
    @return uint256 epoch number
    """
    return self._epoch_at(block.timestamp)


@internal
@view
def _epoch_start_time() -> uint256:
    """
    @notice Get timestamp of the current mining epoch start
    @return Timestamp of the epoch
    """
    return self.first_epoch_time + self._current_epoch() * self.epoch_length


@external
@view
def epoch_at(_timestamp: uint256) -> uint256:
    """
    @notice gives epoch number for a given time (0 for first epoch)
    @return uint256 epoch number
    """
    return self._epoch_at(_timestamp)


@external
@view
def epoch_start_time(_epoch: uint256) -> uint256:
    """
    @notice gives epoch start time for a given epoch number
    @return uint256 epoch timestamp
    """
    return self.first_epoch_time + _epoch * self.epoch_length


@external
@view
def rate_at(_timestamp: uint256) -> uint256:
    """
    @notice give rewards emission rate for timestamp
    @return uint256 epoch rate
    """
    if _timestamp < self.first_epoch_time:
        return 0

    return self.rewards[self._epoch_at(_timestamp)] / self.epoch_length


@external
@view
def current_epoch() -> uint256:
    """
    @notice gives current reward epoch number (0 for first epoch)
    @return uint256 epoch number
    """
    return self._current_epoch()


@external
@view
def future_epoch_time() -> uint256:
    """
    @notice Get timestamp of the next mining epoch start
    @return Timestamp of the next epoch
    """
    return self._epoch_start_time() + self.epoch_length


@external
@view
def future_epoch_rate() -> uint256:
    """
    @notice Get reward rate of the next mining epoch
    @return reward rate
    """
    return self.rewards[self._current_epoch() + 1] / self.epoch_length


@external
def set_admin(_admin: address):
    """
    @notice Set the new admin
    @param _admin New admin address
    """
    assert msg.sender == self.admin  # dev: admin only
    self.admin = _admin
    log SetAdmin(_admin)


@external
def set_rewards_at(_epoch: uint256, _reward: uint256):
    """
    @notice set future epoch reward
    """
    assert msg.sender == self.admin  # dev: admin only
    assert _epoch > self._current_epoch()  # dev: can only modify future rates

    self.rewards[_epoch] = _reward


@external
def set_rewards_starting_at(_epoch: uint256, _rewards: uint256[10]):
    """
    @notice set future rewards starting at epoch _epoch
    """
    assert msg.sender == self.admin  # dev: admin only
    assert _epoch > self._current_epoch()  # dev: can only modify future rewards

    for index in range(10):
        self.rewards[_epoch + index] = _rewards[index]

Contract ABI

[{"name":"SetAdmin","inputs":[{"name":"admin","type":"address","indexed":false}],"anonymous":false,"type":"event"},{"stateMutability":"nonpayable","type":"constructor","inputs":[{"name":"_epoch_length","type":"uint256"},{"name":"_admin","type":"address"}],"outputs":[]},{"stateMutability":"view","type":"function","name":"epoch_at","inputs":[{"name":"_timestamp","type":"uint256"}],"outputs":[{"name":"","type":"uint256"}],"gas":7475},{"stateMutability":"view","type":"function","name":"epoch_start_time","inputs":[{"name":"_epoch","type":"uint256"}],"outputs":[{"name":"","type":"uint256"}],"gas":4918},{"stateMutability":"view","type":"function","name":"rate_at","inputs":[{"name":"_timestamp","type":"uint256"}],"outputs":[{"name":"","type":"uint256"}],"gas":14070},{"stateMutability":"view","type":"function","name":"current_epoch","inputs":[],"outputs":[{"name":"","type":"uint256"}],"gas":14997},{"stateMutability":"view","type":"function","name":"future_epoch_time","inputs":[],"outputs":[{"name":"","type":"uint256"}],"gas":36854},{"stateMutability":"view","type":"function","name":"future_epoch_rate","inputs":[],"outputs":[{"name":"","type":"uint256"}],"gas":19559},{"stateMutability":"nonpayable","type":"function","name":"set_admin","inputs":[{"name":"_admin","type":"address"}],"outputs":[],"gas":39075},{"stateMutability":"nonpayable","type":"function","name":"set_rewards_at","inputs":[{"name":"_epoch","type":"uint256"},{"name":"_reward","type":"uint256"}],"outputs":[],"gas":52416},{"stateMutability":"nonpayable","type":"function","name":"set_rewards_starting_at","inputs":[{"name":"_epoch","type":"uint256"},{"name":"_rewards","type":"uint256[10]"}],"outputs":[],"gas":370972},{"stateMutability":"view","type":"function","name":"admin","inputs":[],"outputs":[{"name":"","type":"address"}],"gas":2658},{"stateMutability":"view","type":"function","name":"first_epoch_time","inputs":[],"outputs":[{"name":"","type":"uint256"}],"gas":2688},{"stateMutability":"view","type":"function","name":"epoch_length","inputs":[],"outputs":[{"name":"","type":"uint256"}],"gas":2718},{"stateMutability":"view","type":"function","name":"rewards","inputs":[{"name":"arg0","type":"uint256"}],"outputs":[{"name":"","type":"uint256"}],"gas":2793}]

60406104fe61014039602060206104fe0160c03960c05160a01c6104f957610160516000556101405160025542610140518080156104f957820490509050610140518082028215828483041417156104f95780905090509050610140518082106104f957808203905090506001556104e156600436101561000d57610388565b600035601c526000513461046a57639a1586ef81141561004c5760043561014052610140516006580161038e565b6101a0526101a05160005260206000f35b6322026ada8114156100915760015460043560025480820282158284830414171561046a5780905090509050818183011061046a578082019050905060005260206000f35b6339935cf08114156101055760015460043510156100b457600060005260206000f35b600160043561014052610140516006580161038e565b6101a0526101a0516c01431e0fae6d7217caa000000081101561046a57026003015460025480801561046a5782049050905060005260206000f35b639372b4e481141561012b57600658016103e2565b610140526101405160005260206000f35b63be5d1be98114156101645760065801610414565b6101405261014051600254818183011061046a578082019050905060005260206000f35b63c67f46e08114156101c8576001600658016103e2565b61014052610140516001818183011061046a57808201905090506c01431e0fae6d7217caa000000081101561046a57026003015460025480801561046a5782049050905060005260206000f35b63e9333fab81141561021e5760043560a01c61046a5760005433141561046a57600435600055600435610140527f5a272403b402d892977df56625f4164ccaf70ca3863991c43ecfe76a6905b0a16020610140a1005b63d284abbb8114156102725760005433141561046a57600658016103e2565b6101405261014051600435111561046a5760243560016004356c01431e0fae6d7217caa000000081101561046a570260030155005b6341eec7ab81141561030a5760005433141561046a57600658016103e2565b6101405261014051600435111561046a576101406000600a818352015b602461014051600a81101561046a576020020135600160043561014051818183011061046a57808201905090506c01431e0fae6d7217caa000000081101561046a5702600301555b81516001018083528114156102ae575b5050005b63f851a4408114156103225760005460005260206000f35b6310ca275a81141561033a5760015460005260206000f35b634231bfe18114156103525760025460005260206000f35b63f301af428114156103865760016004356c01431e0fae6d7217caa000000081101561046a57026003015460005260206000f35b505b60006000fd5b61016052610140526001546101405110156103b157600060005260005161016051565b6101405160015480821061046a578082039050905060025480801561046a5782049050905060005260005161016051565b61014052610140514261016052610160516006580161038e565b6101c052610140526101c05160005260005161014051565b6101405260015461014051600658016103e2565b61016052610140526101605160025480820282158284830414171561046a5780905090509050818183011061046a578082019050905060005260005161014051565b600080fd5b6100726104e1036100726000396100726104e1036000f35b600080fd0000000000000000000000000000000000000000000000000000000000093a80000000000000000000000000b982841d8caf7ccc1b5c8ec414347316f54a06c9

Constructor Arguments (ABI-Encoded and is the last bytes of the Contract Creation Code above)

0000000000000000000000000000000000000000000000000000000000093a80000000000000000000000000b982841d8caf7ccc1b5c8ec414347316f54a06c9

-----Decoded View---------------
Arg [0] : _epoch_length (uint256): 604800
Arg [1] : _admin (address): 0xb982841d8caf7ccc1b5c8ec414347316f54a06c9

-----Encoded View---------------
2 Constructor Arguments found :
Arg [0] : 0000000000000000000000000000000000000000000000000000000000093a80
Arg [1] : 000000000000000000000000b982841d8caf7ccc1b5c8ec414347316f54a06c9


Block Transaction Gas Used Reward
Age Block Fee Address BC Fee Address Voting Power Jailed Incoming
Block Uncle Number Difficulty Gas Used Reward
Loading
Make sure to use the "Vote Down" button for any spammy posts, and the "Vote Up" for interesting conversations.