ETH Price: $2,349.81 (+0.96%)
Gas: 1.99 Gwei

Token

Current Thing (THING)
 

Overview

Max Total Supply

3,317,598,173.2129527240319191 THING

Holders

47

Total Transfers

-

Market

Onchain Market Cap

$0.00

Circulating Supply Market Cap

-

Other Info

Token Contract (WITH 18 Decimals)

Loading...
Loading
Loading...
Loading
Loading...
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.3.7

Optimization Enabled:
N/A

Other Settings:
MIT license

Contract Source Code (Vyper language format)

# @version 0.3.7

"""
@title Current Thing ERC-20 Token ($THING)
@author npcers.eth
@notice 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 Approval:
    owner: indexed(address)
    spender: indexed(address)
    value: uint256

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


name: public(String[64])
symbol: public(String[32])
decimals: public(uint256)
totalSupply: public(uint256)

balances: HashMap[address, uint256]
allowances: HashMap[address, HashMap[address, uint256]]

# Contract Specific Addresses
npc: public(address)
owner: public(address)
minter: public(address)

# Epoch
current_epoch: public(uint256)
current_thing_archive: public(HashMap[uint256, String[256]])


@external
def __init__():
    self.name = "Current Thing"
    self.symbol = "THING"
    self.decimals = 18
    self.owner = msg.sender
    self.minter = msg.sender
    self.current_epoch = 0
    self.current_thing_archive[0] = "Genesis Thing"


@view
@external
def balanceOf(_owner: address) -> uint256:
    """
    @notice Getter to check the current balance of an address
    @param _owner Address to query the balance of
    @return Token balance
    """
    return self.balances[_owner]


@view
@external
def allowance(_owner: address, _spender: address) -> uint256:
    """
    @notice Getter to 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 The amount of tokens still available for the spender
    """
    return self.allowances[_owner][_spender]


@external
def approve(_spender: address, _value: uint256) -> bool:
    """
    @notice Approve an address to spend the specified amount of tokens on behalf of msg.sender
    @dev 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
    @param _spender The address which will spend the funds.
    @param _value The amount of tokens to be spent.
    @return Success boolean
    """
    self.allowances[msg.sender][_spender] = _value
    log Approval(msg.sender, _spender, _value)
    return True


@internal
def _transfer(_from: address, _to: address, _value: uint256):
    """
    @dev Internal shared logic for transfer and transferFrom
    """
    assert self.balances[_from] >= _value, "Insufficient balance"
    assert _to != empty(address)
    self.balances[_from] -= _value
    self.balances[_to] += _value
    log Transfer(_from, _to, _value)


@external
def transfer(_to: address, _value: uint256) -> bool:
    """
    @notice Transfer tokens to a specified address
    @dev Vyper does not allow underflows, so attempting to transfer more tokens than an account has will revert
    @param _to The address to transfer to
    @param _value The amount to be transferred
    @return Success boolean
    """
    self._transfer(msg.sender, _to, _value)
    return True


@external
def transferFrom(_from: address, _to: address, _value: uint256) -> bool:
    """
    @notice Transfer tokens from one address to another
    @dev Vyper does not allow underflows, so attempting to transfer more tokens than an account has will revert
    @param _from The address which you want to send tokens from
    @param _to The address which you want to transfer to
    @param _value The amount of tokens to be transferred
    @return Success boolean
    """
    assert self.allowances[_from][msg.sender] >= _value, "Insufficient allowance"
    self.allowances[_from][msg.sender] -= _value
    self._transfer(_from, _to, _value)
    return True


@external
@view
def current_thing() -> String[256]:
    """
    @notice The Current Thing
    @return What NPCs support
    """
    return self.current_thing_archive[self.current_epoch]


@external
def new_current_thing(current_thing: String[256]):
    """
    @notice Store a new current thing
    @dev Only admin or authorized minter, updates a new epoch
    @param current_thing The new current thing
    """
    assert msg.sender in [self.owner, self.minter]
    self.current_epoch += 1
    self.current_thing_archive[self.current_epoch] = current_thing


@internal
def _mint(addr: address, amount: uint256):
    self.balances[addr] += amount
    self.totalSupply += amount


@external
def mint(recipient: address, amount: uint256):
    """
    @notice Mint tokens
    @param recipient Receiver of tokens
    @param amount Quantity to mint
    @dev Only owner or minter
    """

    assert msg.sender in [self.owner, self.minter]
    self._mint(recipient, amount)


@external
def admin_set_owner(new_owner: address):
    """
    @notice Update owner of contract
    @param new_owner New contract owner address
    """
    assert msg.sender == self.owner  # dev: "Admin Only"
    self.owner = new_owner


@external
def admin_set_minter(new_minter: address):
    """
    @notice Update authorized minter address
    @param new_minter New contract owner address
    """
    assert msg.sender == self.owner  # dev: "Admin Only"
    self.minter = new_minter


@external
def admin_set_npc_addr(addr: address):
    """
    @notice Update Address for NPC NFT
    @param addr New address
    """

    assert msg.sender == self.owner
    self.npc = addr

Contract Security Audit

Contract ABI

[{"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":"Transfer","inputs":[{"name":"sender","type":"address","indexed":true},{"name":"receiver","type":"address","indexed":true},{"name":"value","type":"uint256","indexed":false}],"anonymous":false,"type":"event"},{"stateMutability":"nonpayable","type":"constructor","inputs":[],"outputs":[]},{"stateMutability":"view","type":"function","name":"balanceOf","inputs":[{"name":"_owner","type":"address"}],"outputs":[{"name":"","type":"uint256"}]},{"stateMutability":"view","type":"function","name":"allowance","inputs":[{"name":"_owner","type":"address"},{"name":"_spender","type":"address"}],"outputs":[{"name":"","type":"uint256"}]},{"stateMutability":"nonpayable","type":"function","name":"approve","inputs":[{"name":"_spender","type":"address"},{"name":"_value","type":"uint256"}],"outputs":[{"name":"","type":"bool"}]},{"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":"view","type":"function","name":"current_thing","inputs":[],"outputs":[{"name":"","type":"string"}]},{"stateMutability":"nonpayable","type":"function","name":"new_current_thing","inputs":[{"name":"current_thing","type":"string"}],"outputs":[]},{"stateMutability":"nonpayable","type":"function","name":"mint","inputs":[{"name":"recipient","type":"address"},{"name":"amount","type":"uint256"}],"outputs":[]},{"stateMutability":"nonpayable","type":"function","name":"admin_set_owner","inputs":[{"name":"new_owner","type":"address"}],"outputs":[]},{"stateMutability":"nonpayable","type":"function","name":"admin_set_minter","inputs":[{"name":"new_minter","type":"address"}],"outputs":[]},{"stateMutability":"nonpayable","type":"function","name":"admin_set_npc_addr","inputs":[{"name":"addr","type":"address"}],"outputs":[]},{"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":"uint256"}]},{"stateMutability":"view","type":"function","name":"totalSupply","inputs":[],"outputs":[{"name":"","type":"uint256"}]},{"stateMutability":"view","type":"function","name":"npc","inputs":[],"outputs":[{"name":"","type":"address"}]},{"stateMutability":"view","type":"function","name":"owner","inputs":[],"outputs":[{"name":"","type":"address"}]},{"stateMutability":"view","type":"function","name":"minter","inputs":[],"outputs":[{"name":"","type":"address"}]},{"stateMutability":"view","type":"function","name":"current_epoch","inputs":[],"outputs":[{"name":"","type":"uint256"}]},{"stateMutability":"view","type":"function","name":"current_thing_archive","inputs":[{"name":"arg0","type":"uint256"}],"outputs":[{"name":"","type":"string"}]}]

3461095e57600d6040527f43757272656e74205468696e6700000000000000000000000000000000000000606052604080518060005560208201805160015550505060056040527f5448494e470000000000000000000000000000000000000000000000000000006060526040805180600355602082018051600455505050601260055533600a5533600b556000600c55600d6040527f47656e65736973205468696e67000000000000000000000000000000000000006060526040805180600d6000602052600052604060002055602082016001600d6000602052600052604060002001815181555050505061085f6100fe6100003961085f610000f36003361161000c57610709565b60003560e01c3461084d576370a082318118610052576024361061084d576004358060a01c61084d57604052600760405160205260005260406000205460605260206060f35b63dd62ed3e81186100ac576044361061084d576004358060a01c61084d576040526024358060a01c61084d576060526008604051602052600052604060002080606051602052600052604060002090505460805260206080f35b63095ea7b3811861012b576044361061084d576004358060a01c61084d576040526024356008336020526000526040600020806040516020526000526040600020905055604051337f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92560243560605260206060a3600160605260206060f35b63a9059cbb8118610171576044361061084d576004358060a01c61084d5760e0523360405260e05160605260243560805261016461070f565b6001610100526020610100f35b6323b872dd811861028b576064361061084d576004358060a01c61084d5760e0526024358060a01c61084d5761010052604435600860e051602052600052604060002080336020526000526040600020905054101561022e576016610120527f496e73756666696369656e7420616c6c6f77616e6365000000000000000000006101405261012050610120518061014001601f826000031636823750506308c379a060e052602061010052601f19601f61012051011660440160fcfd5b600860e0516020526000526040600020803360205260005260406000209050805460443580820382811161084d579050905081555060e0516040526101005160605260443560805261027e61070f565b6001610120526020610120f35b633f169b6a8118610325576004361061084d57602080604052600d600c5460205260005260406000208160400181548082526001830160208301600083601f0160051c6008811161084d5780156102f457905b808401548160051b8401526001018181186102de575b50505050508051806020830101601f82600003163682375050601f19601f8251602001011690509050810190506040f35b639c4207a781186103ea576044361061084d5760043560040161010081351161084d5780358060405260208201818160603750505033600a54811861036b576001610372565b600b548118155b90501561084d57600c546001810181811061084d579050600c5560405180600d600c546020526000526040600020556001600d600c54602052600052604060002001600082601f0160051c6008811161084d5780156103e457905b8060051b60600151818401556001018181186103cd575b50505050005b6340c10f198118610440576044361061084d576004358060a01c61084d5760805233600a54811861041c576001610423565b600b548118155b90501561084d5760805160405260243560605261043e61080e565b005b63ab3d14598118610472576024361061084d576004358060a01c61084d57604052600a54331861084d57604051600a55005b632bf0111781186104a4576024361061084d576004358060a01c61084d57604052600a54331861084d57604051600b55005b63a952753181186104d6576024361061084d576004358060a01c61084d57604052600a54331861084d57604051600955005b6306fdde03811861055b576004361061084d576020806040528060400160005480825260208201600082601f0160051c6002811161084d57801561052d57905b80600101548160051b840152600101818118610516575b505050508051806020830101601f82600003163682375050601f19601f825160200101169050810190506040f35b6395d89b4181186105b3576004361061084d576020806040528060400160035480825260208201600454815250508051806020830101601f82600003163682375050601f19601f825160200101169050810190506040f35b63313ce56781186105d2576004361061084d5760055460405260206040f35b6318160ddd81186105f1576004361061084d5760065460405260206040f35b6360d72afe8118610610576004361061084d5760095460405260206040f35b638da5cb5b811861062f576004361061084d57600a5460405260206040f35b6307546172811861064e576004361061084d57600b5460405260206040f35b639372b4e4811861066d576004361061084d57600c5460405260206040f35b63bf7d009e8118610707576024361061084d57602080604052600d60043560205260005260406000208160400181548082526001830160208301600083601f0160051c6008811161084d5780156106d657905b808401548160051b8401526001018181186106c0575b50505050508051806020830101601f82600003163682375050601f19601f8251602001011690509050810190506040f35b505b60006000fd5b6080516007604051602052600052604060002054101561078657601460a0527f496e73756666696369656e742062616c616e636500000000000000000000000060c05260a05060a0518060c001601f826000031636823750506308c379a06060526020608052601f19601f60a0510116604401607cfd5b6060511561084d5760076040516020526000526040600020805460805180820382811161084d579050905081555060076060516020526000526040600020805460805180820182811061084d57905090508155506060516040517fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef60805160a052602060a0a3565b60076040516020526000526040600020805460605180820182811061084d579050905081555060065460605180820182811061084d5790509050600655565b600080fda165767970657283000307000b005b600080fd

Deployed Bytecode

0x6003361161000c57610709565b60003560e01c3461084d576370a082318118610052576024361061084d576004358060a01c61084d57604052600760405160205260005260406000205460605260206060f35b63dd62ed3e81186100ac576044361061084d576004358060a01c61084d576040526024358060a01c61084d576060526008604051602052600052604060002080606051602052600052604060002090505460805260206080f35b63095ea7b3811861012b576044361061084d576004358060a01c61084d576040526024356008336020526000526040600020806040516020526000526040600020905055604051337f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92560243560605260206060a3600160605260206060f35b63a9059cbb8118610171576044361061084d576004358060a01c61084d5760e0523360405260e05160605260243560805261016461070f565b6001610100526020610100f35b6323b872dd811861028b576064361061084d576004358060a01c61084d5760e0526024358060a01c61084d5761010052604435600860e051602052600052604060002080336020526000526040600020905054101561022e576016610120527f496e73756666696369656e7420616c6c6f77616e6365000000000000000000006101405261012050610120518061014001601f826000031636823750506308c379a060e052602061010052601f19601f61012051011660440160fcfd5b600860e0516020526000526040600020803360205260005260406000209050805460443580820382811161084d579050905081555060e0516040526101005160605260443560805261027e61070f565b6001610120526020610120f35b633f169b6a8118610325576004361061084d57602080604052600d600c5460205260005260406000208160400181548082526001830160208301600083601f0160051c6008811161084d5780156102f457905b808401548160051b8401526001018181186102de575b50505050508051806020830101601f82600003163682375050601f19601f8251602001011690509050810190506040f35b639c4207a781186103ea576044361061084d5760043560040161010081351161084d5780358060405260208201818160603750505033600a54811861036b576001610372565b600b548118155b90501561084d57600c546001810181811061084d579050600c5560405180600d600c546020526000526040600020556001600d600c54602052600052604060002001600082601f0160051c6008811161084d5780156103e457905b8060051b60600151818401556001018181186103cd575b50505050005b6340c10f198118610440576044361061084d576004358060a01c61084d5760805233600a54811861041c576001610423565b600b548118155b90501561084d5760805160405260243560605261043e61080e565b005b63ab3d14598118610472576024361061084d576004358060a01c61084d57604052600a54331861084d57604051600a55005b632bf0111781186104a4576024361061084d576004358060a01c61084d57604052600a54331861084d57604051600b55005b63a952753181186104d6576024361061084d576004358060a01c61084d57604052600a54331861084d57604051600955005b6306fdde03811861055b576004361061084d576020806040528060400160005480825260208201600082601f0160051c6002811161084d57801561052d57905b80600101548160051b840152600101818118610516575b505050508051806020830101601f82600003163682375050601f19601f825160200101169050810190506040f35b6395d89b4181186105b3576004361061084d576020806040528060400160035480825260208201600454815250508051806020830101601f82600003163682375050601f19601f825160200101169050810190506040f35b63313ce56781186105d2576004361061084d5760055460405260206040f35b6318160ddd81186105f1576004361061084d5760065460405260206040f35b6360d72afe8118610610576004361061084d5760095460405260206040f35b638da5cb5b811861062f576004361061084d57600a5460405260206040f35b6307546172811861064e576004361061084d57600b5460405260206040f35b639372b4e4811861066d576004361061084d57600c5460405260206040f35b63bf7d009e8118610707576024361061084d57602080604052600d60043560205260005260406000208160400181548082526001830160208301600083601f0160051c6008811161084d5780156106d657905b808401548160051b8401526001018181186106c0575b50505050508051806020830101601f82600003163682375050601f19601f8251602001011690509050810190506040f35b505b60006000fd5b6080516007604051602052600052604060002054101561078657601460a0527f496e73756666696369656e742062616c616e636500000000000000000000000060c05260a05060a0518060c001601f826000031636823750506308c379a06060526020608052601f19601f60a0510116604401607cfd5b6060511561084d5760076040516020526000526040600020805460805180820382811161084d579050905081555060076060516020526000526040600020805460805180820182811061084d57905090508155506060516040517fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef60805160a052602060a0a3565b60076040516020526000526040600020805460605180820182811061084d579050905081555060065460605180820182811061084d5790509050600655565b600080fda165767970657283000307000b

Loading...
Loading
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.