Token bETH

Overview [ERC-20]

Max Total Supply:
261.374474189999999999 bETH

Holders:
19

Transfers:
-

Profile Summary

 
Contract:
0xA60100d5e12E9F83c1B04997314cf11685A618fF0xA60100d5e12E9F83c1B04997314cf11685A618fF

Decimals:
18
Loading
[ Download CSV Export  ] 
Loading
[ Download CSV Export  ] 
Loading

Click here to update the token information / general information
# Exchange Pair Price  24H Volume % Volume

Contract Source Code Verified (Exact Match)

Contract Name:
Vyper_contract

Compiler Version
vyper:0.2.12

Optimization Enabled:
N/A

Other Settings:
MIT license

Contract Source Code (Vyper language format)

# @version 0.2.12
# @author banteg
# @license MIT
from vyper.interfaces import ERC20

implements: ERC20


event Transfer:
    sender: indexed(address)
    receiver: indexed(address)
    value: uint256


event Approval:
    owner: indexed(address)
    spender: indexed(address)
    value: uint256


event AdminChanged:
    new_admin: address


event MinterChanged:
    new_minter: address


name: public(String[26])
symbol: public(String[7])
decimals: public(uint256)
version: public(String[1])

balanceOf: public(HashMap[address, uint256])
allowance: public(HashMap[address, HashMap[address, uint256]])
totalSupply: public(uint256)

nonces: public(HashMap[address, uint256])
DOMAIN_SEPARATOR: public(bytes32)
DOMAIN_TYPE_HASH: constant(bytes32) = keccak256('EIP712Domain(string name,string version,uint256 chainId,address verifyingContract)')
PERMIT_TYPE_HASH: constant(bytes32) = keccak256('Permit(address owner,address spender,uint256 value,uint256 nonce,uint256 deadline)')

admin: public(address)
minter: public(address)


@external
def __init__(_symbol: String[7], _minter: address, _admin: address):
    self.name = 'bETH'
    self.symbol = _symbol
    self.decimals = 18
    self.version = '1'
    self.DOMAIN_SEPARATOR = keccak256(
        concat(
            DOMAIN_TYPE_HASH,
            keccak256(convert(self.name, Bytes[26])),
            keccak256(convert(self.version, Bytes[1])),
            convert(chain.id, bytes32),
            convert(self, bytes32)
        )
    )
    self.minter = _minter
    self.admin = _admin
    log AdminChanged(_admin)
    log MinterChanged(_minter)


@external
def change_admin(new_admin: address):
    assert msg.sender == self.admin
    self.admin = new_admin
    log AdminChanged(new_admin)


@external
def set_minter(new_minter: address):
    assert msg.sender == self.admin
    self.minter = new_minter
    log MinterChanged(new_minter)


@external
def mint(owner: address, amount: uint256):
    assert msg.sender == self.minter
    self.totalSupply += amount
    self.balanceOf[owner] += amount
    log Transfer(ZERO_ADDRESS, owner, amount)


@external
def burn(owner: address, amount: uint256):
    assert msg.sender == self.minter
    self.totalSupply -= amount
    self.balanceOf[owner] -= amount
    log Transfer(owner, ZERO_ADDRESS, amount)


@internal
def _transfer(sender: address, receiver: address, amount: uint256):
    assert receiver not in [self, ZERO_ADDRESS]
    self.balanceOf[sender] -= amount
    self.balanceOf[receiver] += amount
    log Transfer(sender, receiver, amount)


@external
def transfer(receiver: address, amount: uint256) -> bool:
    self._transfer(msg.sender, receiver, amount)
    return True


@external
def transferFrom(sender: address, receiver: address, amount: uint256) -> bool:
    if msg.sender != sender and self.allowance[sender][msg.sender] != MAX_UINT256:
        self.allowance[sender][msg.sender] -= amount
        log Approval(sender, msg.sender, self.allowance[sender][msg.sender])
    self._transfer(sender, receiver, amount)
    return True


@external
def approve(spender: address, amount: uint256) -> bool:
    self.allowance[msg.sender][spender] = amount
    log Approval(msg.sender, spender, amount)
    return True


@external
def permit(owner: address, spender: address, amount: uint256, expiry: uint256, signature: Bytes[65]) -> bool:
    assert owner != ZERO_ADDRESS  # dev: invalid owner
    assert expiry == 0 or expiry >= block.timestamp  # dev: permit expired
    nonce: uint256 = self.nonces[owner]
    digest: bytes32 = keccak256(
        concat(
            b'\x19\x01',
            self.DOMAIN_SEPARATOR,
            keccak256(
                concat(
                    PERMIT_TYPE_HASH,
                    convert(owner, bytes32),
                    convert(spender, bytes32),
                    convert(amount, bytes32),
                    convert(nonce, bytes32),
                    convert(expiry, bytes32),
                )
            )
        )
    )
    # NOTE: the signature is packed as r, s, v
    r: uint256 = convert(slice(signature, 0, 32), uint256)
    s: uint256 = convert(slice(signature, 32, 32), uint256)
    v: uint256 = convert(slice(signature, 64, 1), uint256)
    assert ecrecover(digest, v, r, s) == owner  # dev: invalid signature
    self.allowance[owner][spender] = amount
    self.nonces[owner] = nonce + 1
    log Approval(owner, spender, amount)
    return True

Contract ABI

[{"name":"Transfer","inputs":[{"name":"sender","type":"address","indexed":true},{"name":"receiver","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":"AdminChanged","inputs":[{"name":"new_admin","type":"address","indexed":false}],"anonymous":false,"type":"event"},{"name":"MinterChanged","inputs":[{"name":"new_minter","type":"address","indexed":false}],"anonymous":false,"type":"event"},{"stateMutability":"nonpayable","type":"constructor","inputs":[{"name":"_symbol","type":"string"},{"name":"_minter","type":"address"},{"name":"_admin","type":"address"}],"outputs":[]},{"stateMutability":"nonpayable","type":"function","name":"change_admin","inputs":[{"name":"new_admin","type":"address"}],"outputs":[],"gas":38895},{"stateMutability":"nonpayable","type":"function","name":"set_minter","inputs":[{"name":"new_minter","type":"address"}],"outputs":[],"gas":38925},{"stateMutability":"nonpayable","type":"function","name":"mint","inputs":[{"name":"owner","type":"address"},{"name":"amount","type":"uint256"}],"outputs":[],"gas":79414},{"stateMutability":"nonpayable","type":"function","name":"burn","inputs":[{"name":"owner","type":"address"},{"name":"amount","type":"uint256"}],"outputs":[],"gas":79432},{"stateMutability":"nonpayable","type":"function","name":"transfer","inputs":[{"name":"receiver","type":"address"},{"name":"amount","type":"uint256"}],"outputs":[{"name":"","type":"bool"}],"gas":78648},{"stateMutability":"nonpayable","type":"function","name":"transferFrom","inputs":[{"name":"sender","type":"address"},{"name":"receiver","type":"address"},{"name":"amount","type":"uint256"}],"outputs":[{"name":"","type":"bool"}],"gas":123130},{"stateMutability":"nonpayable","type":"function","name":"approve","inputs":[{"name":"spender","type":"address"},{"name":"amount","type":"uint256"}],"outputs":[{"name":"","type":"bool"}],"gas":37911},{"stateMutability":"nonpayable","type":"function","name":"permit","inputs":[{"name":"owner","type":"address"},{"name":"spender","type":"address"},{"name":"amount","type":"uint256"},{"name":"expiry","type":"uint256"},{"name":"signature","type":"bytes"}],"outputs":[{"name":"","type":"bool"}],"gas":91104},{"stateMutability":"view","type":"function","name":"name","inputs":[],"outputs":[{"name":"","type":"string"}],"gas":10653},{"stateMutability":"view","type":"function","name":"symbol","inputs":[],"outputs":[{"name":"","type":"string"}],"gas":10683},{"stateMutability":"view","type":"function","name":"decimals","inputs":[],"outputs":[{"name":"","type":"uint256"}],"gas":2688},{"stateMutability":"view","type":"function","name":"version","inputs":[],"outputs":[{"name":"","type":"string"}],"gas":10743},{"stateMutability":"view","type":"function","name":"balanceOf","inputs":[{"name":"arg0","type":"address"}],"outputs":[{"name":"","type":"uint256"}],"gas":2963},{"stateMutability":"view","type":"function","name":"allowance","inputs":[{"name":"arg0","type":"address"},{"name":"arg1","type":"address"}],"outputs":[{"name":"","type":"uint256"}],"gas":3208},{"stateMutability":"view","type":"function","name":"totalSupply","inputs":[],"outputs":[{"name":"","type":"uint256"}],"gas":2808},{"stateMutability":"view","type":"function","name":"nonces","inputs":[{"name":"arg0","type":"address"}],"outputs":[{"name":"","type":"uint256"}],"gas":3053},{"stateMutability":"view","type":"function","name":"DOMAIN_SEPARATOR","inputs":[],"outputs":[{"name":"","type":"bytes32"}],"gas":2868},{"stateMutability":"view","type":"function","name":"admin","inputs":[],"outputs":[{"name":"","type":"address"}],"gas":2898},{"stateMutability":"view","type":"function","name":"minter","inputs":[],"outputs":[{"name":"","type":"address"}],"gas":2928}]

6060611036610140396027602061103660c03960c051611036016101a0396007602061103660c03960c05160040135111561003957600080fd5b602060206110360160c03960c05160a01c1561005457600080fd5b602060406110360160c03960c05160a01c1561006f57600080fd5b6004610200527f62455448000000000000000000000000000000000000000000000000000000006102205261020080600060c052602060c020602082510161012060006002818352015b826101205160200211156100cc576100ee565b61012051602002850151610120518501555b81516001018083528114156100b9575b5050505050506101a080600160c052602060c020602082510161012060006002818352015b8261012051602002111561012657610148565b61012051602002850151610120518501555b8151600101808352811415610113575b50505050505060126002556001610200527f31000000000000000000000000000000000000000000000000000000000000006102205261020080600360c052602060c020602082510161012060006002818352015b826101205160200211156101b0576101d2565b61012051602002850151610120518501555b815160010180835281141561019d575b50505050505060007f8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f6020826104600101526020810190506000808060c052602060c0206103a0602082540161012060006002818352015b8261012051602002111561023d5761025f565b61012051850154610120516020028501525b815160010180835281141561022a575b5050505050508060c052602060c020546103c02090506020826104600101526020810190506003808060c052602060c020610400602082540161012060006002818352015b826101205160200211156102b7576102d9565b61012051850154610120516020028501525b81516001018083528114156102a4575b5050505050508060c052602060c0205461042020905060208261046001015260208101905046602082610460010152602081019050306020826104600101526020810190508061046052610460905080516020820120905060085561016051600a556101805160095561018051610200527f7ce7ec0b50378fb6c0186ffb5f48325f6593fcb4ca4386f21861af3129188f5c6020610200a161016051610200527fb6b8f1859c5c352e5ffad07d0f77e384ac725512c015bd3a3ffc885831c8a4256020610200a161101e56600436101561000d57610b68565b600035601c52600051341561002157600080fd5b63158686b58114156100815760043560a01c1561003d57600080fd5b600954331461004b57600080fd5b600435600955600435610140527f7ce7ec0b50378fb6c0186ffb5f48325f6593fcb4ca4386f21861af3129188f5c6020610140a1005b631652e9fc8114156100e15760043560a01c1561009d57600080fd5b60095433146100ab57600080fd5b600435600a55600435610140527fb6b8f1859c5c352e5ffad07d0f77e384ac725512c015bd3a3ffc885831c8a4256020610140a1005b6340c10f1981141561018e5760043560a01c156100fd57600080fd5b600a54331461010b57600080fd5b6006805460243581818301101561012157600080fd5b80820190509050815550600460043560e05260c052604060c020805460243581818301101561014f57600080fd5b808201905090508155506024356101405260043560007fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef6020610140a3005b639dc29fac8114156102375760043560a01c156101aa57600080fd5b600a5433146101b857600080fd5b60068054602435808210156101cc57600080fd5b80820390509050815550600460043560e05260c052604060c0208054602435808210156101f857600080fd5b808203905090508155506024356101405260006004357fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef6020610140a3005b63a9059cbb8114156102895760043560a01c1561025357600080fd5b3361014052600435610160526024356101805261018051610160516101405160065801610b6e565b600050600160005260206000f35b6323b872dd8114156103c95760043560a01c156102a557600080fd5b60243560a01c156102b557600080fd5b600435331815610304577fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff600560043560e05260c052604060c0203360e05260c052604060c020541415610307565b60005b1561039157600560043560e05260c052604060c0203360e05260c052604060c02080546044358082101561033a57600080fd5b80820390509050815550600560043560e05260c052604060c0203360e05260c052604060c0205461014052336004357f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9256020610140a35b60043561014052602435610160526044356101805261018051610160516101405160065801610b6e565b600050600160005260206000f35b63095ea7b38114156104425760043560a01c156103e557600080fd5b60243560053360e05260c052604060c02060043560e05260c052604060c0205560243561014052600435337f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9256020610140a3600160005260206000f35b639fd5a6cf81141561083f5760043560a01c1561045e57600080fd5b60243560a01c1561046e57600080fd5b606160843560040161014037604160843560040135111561048e57600080fd5b60006004351861049d57600080fd5b60643515156104ad5760016104b4565b4260643510155b6104bd57600080fd5b600760043560e05260c052604060c020546101e05260006002610520527f19010000000000000000000000000000000000000000000000000000000000006105405261052060028060208461078001018260208501600060045af150508051820191505060085460208261078001015260208101905060007f6e71edae12b1b97f4d1f60370fef10105fa2faae0126114a169c64845d6126c96020826106800101526020810190506004356020826106800101526020810190506024356020826106800101526020810190506044356020826106800101526020810190506101e05160208261068001015260208101905060643560208261068001015260208101905080610680526106809050805160208201209050602082610780010152602081019050806107805261078090508051602082012090506102005260006020602082066103000161014051828401111561061757600080fd5b6041806103208260206020880688030161014001600060045af150508181528090509050905080602001516000825180602090131561065557600080fd5b809190121561066357600080fd5b806020036101000a82049050905090506102205260206020602082066103200161014051828401111561069557600080fd5b6041806103408260206020880688030161014001600060045af15050818152809050905090508060200151600082518060209013156106d357600080fd5b80919012156106e157600080fd5b806020036101000a82049050905090506102405260406001602082066103400161014051828401111561071357600080fd5b6041806103608260206020880688030161014001600060045af150508181528090509050905080602001516000825180602090131561075157600080fd5b809190121561075f57600080fd5b806020036101000a8204905090509050610260526004356102005161028052610260516102a052610220516102c052610240516102e052602060c0608061028060015afa5060c051146107b157600080fd5b604435600560043560e05260c052604060c02060243560e05260c052604060c020556101e05160018181830110156107e857600080fd5b80820190509050600760043560e05260c052604060c02055604435610280526024356004357f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9256020610280a3600160005260206000f35b6306fdde038114156108e45760008060c052602060c020610180602082540161012060006002818352015b8261012051602002111561087d5761089f565b61012051850154610120516020028501525b815160010180835281141561086a575b50505050505061018051806101a001818260206001820306601f82010390500336823750506020610160526040610180510160206001820306601f8201039050610160f35b6395d89b418114156109895760018060c052602060c020610180602082540161012060006002818352015b8261012051602002111561092257610944565b61012051850154610120516020028501525b815160010180835281141561090f575b50505050505061018051806101a001818260206001820306601f82010390500336823750506020610160526040610180510160206001820306601f8201039050610160f35b63313ce5678114156109a15760025460005260206000f35b6354fd4d50811415610a465760038060c052602060c020610180602082540161012060006002818352015b826101205160200211156109df57610a01565b61012051850154610120516020028501525b81516001018083528114156109cc575b50505050505061018051806101a001818260206001820306601f82010390500336823750506020610160526040610180510160206001820306601f8201039050610160f35b6370a08231811415610a7c5760043560a01c15610a6257600080fd5b600460043560e05260c052604060c0205460005260206000f35b63dd62ed3e811415610ad05760043560a01c15610a9857600080fd5b60243560a01c15610aa857600080fd5b600560043560e05260c052604060c02060243560e05260c052604060c0205460005260206000f35b6318160ddd811415610ae85760065460005260206000f35b637ecebe00811415610b1e5760043560a01c15610b0457600080fd5b600760043560e05260c052604060c0205460005260206000f35b633644e515811415610b365760085460005260206000f35b63f851a440811415610b4e5760095460005260206000f35b6307546172811415610b6657600a5460005260206000f35b505b60006000fd5b6101a052610140526101605261018052306101e05260006102005260006101c0526101c061012060006002818352015b610120516020026101e00151610160511415610bbd5760018352610bcd565b8151600101808352811415610b9e575b5050506101c05115610bde57600080fd5b60046101405160e05260c052604060c02080546101805180821015610c0257600080fd5b8082039050905081555060046101605160e05260c052604060c020805461018051818183011015610c3257600080fd5b80820190509050815550610180516101c05261016051610140517fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef60206101c0a36101a051565b6103a561101e036103a56000396103a561101e036000f30000000000000000000000000000000000000000000000000000000000000060000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002139137fdd974181a49268d7b0ae888634e546900000000000000000000000000000000000000000000000000000000000000046245544800000000000000000000000000000000000000000000000000000000

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

0000000000000000000000000000000000000000000000000000000000000060000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002139137fdd974181a49268d7b0ae888634e546900000000000000000000000000000000000000000000000000000000000000046245544800000000000000000000000000000000000000000000000000000000

-----Decoded View---------------
Arg [0] : _symbol (string): bETH
Arg [1] : _minter (address): 0x0000000000000000000000000000000000000000
Arg [2] : _admin (address): 0x02139137fdd974181a49268d7b0ae888634e5469

-----Encoded View---------------
5 Constructor Arguments found :
Arg [0] : 0000000000000000000000000000000000000000000000000000000000000060
Arg [1] : 0000000000000000000000000000000000000000000000000000000000000000
Arg [2] : 00000000000000000000000002139137fdd974181a49268d7b0ae888634e5469
Arg [3] : 0000000000000000000000000000000000000000000000000000000000000004
Arg [4] : 6245544800000000000000000000000000000000000000000000000000000000


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.