ETH Price: $2,232.51 (-2.50%)

Contract

0x0bd23A23aD1e8f963EBf4A948c523bBd1267186e
 

Overview

ETH Balance

0 ETH

Eth Value

$0.00

Multichain Info

No addresses found
Transaction Hash
Method
Block
From
To
Update Token Add...88822912019-11-06 6:26:341941 days ago1573021594IN
0x0bd23A23...d1267186e
0 ETH0.000383288.51539434
Update Token Add...85940132019-09-21 17:42:531987 days ago1569087773IN
0x0bd23A23...d1267186e
0 ETH0.0006524814.6
Update Token Add...85940092019-09-21 17:41:021987 days ago1569087662IN
0x0bd23A23...d1267186e
0 ETH0.0006571614.6
Update Token Add...85940062019-09-21 17:39:501987 days ago1569087590IN
0x0bd23A23...d1267186e
0 ETH0.000973321.62365591

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 0x06965ECf...122F4F114
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.1.0b11

Optimization Enabled:
N/A

Other Settings:
default evmVersion, None license

Contract Source Code (Vyper language format)

struct PriceInfo:
    price: uint256
    lastUpdate: uint256

contract ERC20():
    def balanceOf(_owner: address) -> uint256: constant
    def decimals() -> uint256: constant

contract DaiPriceOracle:
    def g_priceInfo() -> PriceInfo: constant

PRICE_MULTIPLIER: constant(uint256) = 100000000 # 10**8

# DAI oracle returns DAI/USD price multiplied by 10**18
MIN_DAI_PRICE: constant(uint256) = 950000000000000000 # 0.95*10**18
MAX_DAI_PRICE: constant(uint256) = 1050000000000000000 # 1.05*10**18
# DAI_ORACLE_DIVIDER = 10**18 / PRICE_MULTIPLIER
DAI_ORACLE_DIVIDER: constant(uint256) = 10000000000 # 10**10

TokenAddressUpdated: event({token_address: indexed(address), token_index: indexed(int128)})

name: public(string[16])
owner: public(address)
supportedTokens: public(address[5])
daiAddress: public(address)
daiOracleAddress: public(address)

@public
def __init__(dai_address: address, dai_oracle_address: address):
    assert dai_address != ZERO_ADDRESS
    assert dai_oracle_address != ZERO_ADDRESS

    self.daiAddress = dai_address
    self.daiOracleAddress = dai_oracle_address
    self.supportedTokens[0] = dai_address
    self.owner = msg.sender
    self.name = 'PriceOracle'
    
@public
@constant
def normalized_token_prices(token_address: address) -> uint256:
    token_price: uint256
    token_decimals: uint256 = ERC20(token_address).decimals()
    
    if token_address != self.daiAddress:
        token_price = PRICE_MULTIPLIER
    else:
        price_info: PriceInfo = DaiPriceOracle(self.daiOracleAddress).g_priceInfo()
        token_price = price_info.price
        assert token_price >= MIN_DAI_PRICE
        assert token_price <= MAX_DAI_PRICE
        token_price = token_price / DAI_ORACLE_DIVIDER    

    normalized_price: uint256 = token_price * 10**(18 - token_decimals)
    return normalized_price

@public
@constant
def poolSize(contract_address: address) -> uint256:
    token_address: address
    normalized_price: uint256
    total: uint256 = 0

    for ind in range(5):
        token_address = self.supportedTokens[ind]
        if token_address != ZERO_ADDRESS:
            contract_balance: uint256 = ERC20(token_address).balanceOf(contract_address)
            normalized_price = self.normalized_token_prices(token_address)
            total += contract_balance * normalized_price / PRICE_MULTIPLIER

    return total

@public
def updateTokenAddress(token_address: address, ind: int128) -> bool:
    assert msg.sender == self.owner

    self.supportedTokens[ind] = token_address
    log.TokenAddressUpdated(token_address, ind)

    return True

Contract Security Audit

Contract ABI

API
[{"name":"TokenAddressUpdated","inputs":[{"type":"address","name":"token_address","indexed":true},{"type":"int128","name":"token_index","indexed":true}],"anonymous":false,"type":"event"},{"outputs":[],"inputs":[{"type":"address","name":"dai_address"},{"type":"address","name":"dai_oracle_address"}],"constant":false,"payable":false,"type":"constructor"},{"name":"normalized_token_prices","outputs":[{"type":"uint256","name":"out"}],"inputs":[{"type":"address","name":"token_address"}],"constant":true,"payable":false,"type":"function","gas":6353},{"name":"poolSize","outputs":[{"type":"uint256","name":"out"}],"inputs":[{"type":"address","name":"contract_address"}],"constant":true,"payable":false,"type":"function","gas":51785},{"name":"updateTokenAddress","outputs":[{"type":"bool","name":"out"}],"inputs":[{"type":"address","name":"token_address"},{"type":"int128","name":"ind"}],"constant":false,"payable":false,"type":"function","gas":37434},{"name":"name","outputs":[{"type":"string","name":"out"}],"inputs":[],"constant":true,"payable":false,"type":"function","gas":4018},{"name":"owner","outputs":[{"type":"address","name":"out"}],"inputs":[],"constant":true,"payable":false,"type":"function","gas":633},{"name":"supportedTokens","outputs":[{"type":"address","name":"out"}],"inputs":[{"type":"int128","name":"arg0"}],"constant":true,"payable":false,"type":"function","gas":862},{"name":"daiAddress","outputs":[{"type":"address","name":"out"}],"inputs":[],"constant":true,"payable":false,"type":"function","gas":693},{"name":"daiOracleAddress","outputs":[{"type":"address","name":"out"}],"inputs":[],"constant":true,"payable":false,"type":"function","gas":723}]

Deployed Bytecode

0x600035601c52740100000000000000000000000000000000000000006020526f7fffffffffffffffffffffffffffffff6040527fffffffffffffffffffffffffffffffff8000000000000000000000000000000060605274012a05f1fffffffffffffffffffffffffdabf41c006080527ffffffffffffffffffffffffed5fa0e000000000000000000000000000000000060a05263f1bb108660005114156103715734156100ac57600080fd5b60043560205181106100bd57600080fd5b506004353b6100cb57600080fd5b60043530186100d957600080fd5b60206101e0600463313ce5676101805261019c6004355afa6100fa57600080fd5b6000506101e05161016052600354600435181561011f576305f5e100610140526101cb565b6102006004543b61012f57600080fd5b600454301861013d57600080fd5b60406102a0600463afb1f8d66102405261025c6004545afa61015e57600080fd5b6000506102a0805182528060200151826020015250506102005161014052670d2f13f7789f000061014051101561019457600080fd5b670e92596fd62900006101405111156101ac57600080fd5b6402540be4006101bb57600080fd5b6402540be4006101405104610140525b6101405115156101dc57600061035e565b61016051601210156101ed57600080fd5b61016051601203600a0a600a10610160516012101561020b57600080fd5b61016051601203156001610160516012101561022657600080fd5b6101605160120314171761023957600080fd5b610160516012101561024a57600080fd5b61016051601203600a0a61014051610160516012101561026957600080fd5b61016051601203600a0a600a10610160516012101561028757600080fd5b6101605160120315600161016051601210156102a257600080fd5b610160516012031417176102b557600080fd5b61016051601210156102c657600080fd5b61016051601203600a0a610140510204146102e057600080fd5b61016051601210156102f157600080fd5b61016051601203600a0a600a10610160516012101561030f57600080fd5b61016051601203156001610160516012101561032a57600080fd5b6101605160120314171761033d57600080fd5b610160516012101561034e57600080fd5b61016051601203600a0a61014051025b6102e0526102e05160005260206000f350005b63fa75d160600051141561052f57341561038a57600080fd5b600435602051811061039b57600080fd5b506000610180526101a060006005818352015b6101a051600581106103bf57600080fd5b600260c052602060c020015461014052600061014051181561050d57610140513b6103e957600080fd5b6101405130186103f857600080fd5b602061026060246370a082316101e052600435610200526101fc610140515afa61042157600080fd5b600050610260516101c0526020610300602463f1bb108661028052610140516102a05261029c6000305af161045557600080fd5b610300516101605261018080516305f5e10061047057600080fd5b6305f5e1006101c05115156104865760006104ac565b610160516101c051610160516101c0510204146104a257600080fd5b610160516101c051025b0482510110156104bb57600080fd5b6305f5e1006104c957600080fd5b6305f5e1006101c05115156104df576000610505565b610160516101c051610160516101c0510204146104fb57600080fd5b610160516101c051025b048151018152505b5b81516001018083528114156103ae575b50506101805160005260206000f350005b633d710a9d60005114156105e557341561054857600080fd5b600435602051811061055957600080fd5b506060516024358060405190131561057057600080fd5b809190121561057e57600080fd5b50600154331461058d57600080fd5b600435602435600581106105a057600080fd5b600260c052602060c02001556024356004357fa92882985915193a9370218a3a7e82c81fc53c081fbc542aa6766ba82239902d60006000a3600160005260206000f350005b6306fdde0360005114156106c95734156105fe57600080fd5b60008060c052602060c020610180602082540161012060006002818352015b8261012051602002111561063057610652565b61012051850154610120516020028501525b815160010180835281141561061d575b5050505050506101805160206001820306601f82010390506101e0610180516010818352015b826101e0511115610688576106a4565b60006101e0516101a001535b8151600101808352811415610678575b5050506020610160526040610180510160206001820306601f8201039050610160f350005b638da5cb5b60005114156106f05734156106e257600080fd5b60015460005260206000f350005b639b8ce99a600051141561075557341561070957600080fd5b6060516004358060405190131561071f57600080fd5b809190121561072d57600080fd5b506004356005811061073e57600080fd5b600260c052602060c020015460005260206000f350005b632c387275600051141561077c57341561076e57600080fd5b60035460005260206000f350005b6372df29a760005114156107a357341561079557600080fd5b60045460005260206000f350005b60006000fd

Block Transaction Difficulty Gas Used Reward
View All Blocks Produced

Block Uncle Number Difficulty Gas Used Reward
View All Uncles
Loading...
Loading
Loading...
Loading

Validator Index Block Amount
View All Withdrawals

Transaction Hash Block Value Eth2 PubKey Valid
View All Deposits
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.