Overview
POL Balance
0 POL
POL Value
$0.00More Info
Private Name Tags
ContractCreator
Loading...
Loading
Similar Match Source Code This contract matches the deployed Bytecode of the Source Code for Contract 0x58e35205...2aEc9AE2f The constructor portion of the code might be different and could alter the actual behaviour of the contract
Contract Name:
VNXAUGramOracle
Compiler Version
v0.7.6+commit.7338295f
Optimization Enabled:
Yes with 10000 runs
Other Settings:
default evmVersion
Contract Source Code (Solidity Standard Json-Input format)
// SPDX-License-Identifier: MIT pragma solidity 0.7.6; import {IAggregatorPricingOnly} from '../interfaces/IAggregatorPricingOnly.sol'; /** * This contract sits in front of a VNXAU Chainlink aggregator and * converts the price from USD / troy ounce to USD / gram of gold. */ contract VNXAUGramOracle is IAggregatorPricingOnly { int256 public constant GRAM_PER_TROYOUNCE = int256(31.1034768 * 1e8); address public immutable VNXAU_AGGR_ADDR; constructor(address _aggregator) { VNXAU_AGGR_ADDR = _aggregator; } /** * @dev Fallback function that passes through calls to the address returned by `VNXAU_AGGR_ADDR`. Will run if no other * function in the contract matches the call data. */ fallback() external payable { _passthrough(VNXAU_AGGR_ADDR); } /** * @dev Fallback function that passes through calls to the address returned by `VNXAU_AGGR_ADDR`. Will run if call data * is empty. */ receive() external payable { _passthrough(VNXAU_AGGR_ADDR); } /** * @dev Passes through the current call to `implementation`. * * This function does not return to its internall call site, it will return directly to the external caller. */ function _passthrough(address implementation) internal { // solhint-disable-next-line no-inline-assembly assembly { // Copy msg.data. We take full control of memory in this inline assembly // block because it will not return to Solidity code. We overwrite the // Solidity scratch pad at memory position 0. calldatacopy(0, 0, calldatasize()) // Call the implementation. // out and outsize are 0 because we don't know the size yet. // call contract at address a with input mem[in…(in+insize)) providing // g gas and v wei and output area mem[out…(out+outsize)) // returning 0 on error (eg. out of gas) and 1 on success let result := call( gas(), // gas implementation, // to 0, // don't transfer any ether 0, // pointer to start of input calldatasize(), 0, 0 ) // Copy the returned data. returndatacopy(0, 0, returndatasize()) switch result // delegatecall returns 0 on error. case 0 { revert(0, returndatasize()) } default { return(0, returndatasize()) } } } function latestRoundData() external view override returns (uint80 roundId, int256 answer, uint256 startedAt, uint256 updatedAt, uint80 answeredInRound) { (roundId, answer, startedAt, updatedAt, answeredInRound) = IAggregatorPricingOnly(VNXAU_AGGR_ADDR) .latestRoundData(); answer = (answer * 1e8) / GRAM_PER_TROYOUNCE; } function latestAnswer() external view override returns (int256) { return (IAggregatorPricingOnly(VNXAU_AGGR_ADDR).latestAnswer() * 1e8) / GRAM_PER_TROYOUNCE; } function getAnswer(uint256 roundId) external view override returns (int256) { return (IAggregatorPricingOnly(VNXAU_AGGR_ADDR).getAnswer(roundId) * 1e8) / GRAM_PER_TROYOUNCE; } // IAggregatorPricingOnly function getRoundData( uint80 _roundId ) external view override returns (uint80 roundId, int256 answer, uint256 startedAt, uint256 updatedAt, uint80 answeredInRound) { (roundId, answer, startedAt, updatedAt, answeredInRound) = IAggregatorPricingOnly(VNXAU_AGGR_ADDR).getRoundData( _roundId ); answer = (answer * 1e8) / GRAM_PER_TROYOUNCE; } function proposedGetRoundData( uint80 roundId ) external view override returns (uint80 id, int256 answer, uint256 startedAt, uint256 updatedAt, uint80 answeredInRound) { (id, answer, startedAt, updatedAt, answeredInRound) = IAggregatorPricingOnly(VNXAU_AGGR_ADDR) .proposedGetRoundData(roundId); answer = (answer * 1e8) / GRAM_PER_TROYOUNCE; } function proposedLatestRoundData() external view override returns (uint80 id, int256 answer, uint256 startedAt, uint256 updatedAt, uint80 answeredInRound) { (id, answer, startedAt, updatedAt, answeredInRound) = IAggregatorPricingOnly(VNXAU_AGGR_ADDR) .proposedLatestRoundData(); answer = (answer * 1e8) / GRAM_PER_TROYOUNCE; } }
// SPDX-License-Identifier: MIT pragma solidity 0.7.6; interface IAggregatorPricingOnly { function latestRoundData() external view returns (uint80 roundId, int256 answer, uint256 startedAt, uint256 updatedAt, uint80 answeredInRound); function latestAnswer() external view returns (int256); function getAnswer(uint256 roundId) external view returns (int256); // IAggregatorPricingOnly function getRoundData( uint80 _roundId ) external view returns (uint80 roundId, int256 answer, uint256 startedAt, uint256 updatedAt, uint80 answeredInRound); function proposedGetRoundData( uint80 roundId ) external view returns (uint80 id, int256 answer, uint256 startedAt, uint256 updatedAt, uint80 answeredInRound); function proposedLatestRoundData() external view returns (uint80 id, int256 answer, uint256 startedAt, uint256 updatedAt, uint80 answeredInRound); }
{ "optimizer": { "enabled": true, "runs": 10000 }, "outputSelection": { "*": { "*": [ "evm.bytecode", "evm.deployedBytecode", "devdoc", "userdoc", "metadata", "abi" ] } }, "libraries": {} }
Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
[{"inputs":[{"internalType":"address","name":"_aggregator","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"stateMutability":"payable","type":"fallback"},{"inputs":[],"name":"GRAM_PER_TROYOUNCE","outputs":[{"internalType":"int256","name":"","type":"int256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"VNXAU_AGGR_ADDR","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"roundId","type":"uint256"}],"name":"getAnswer","outputs":[{"internalType":"int256","name":"","type":"int256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint80","name":"_roundId","type":"uint80"}],"name":"getRoundData","outputs":[{"internalType":"uint80","name":"roundId","type":"uint80"},{"internalType":"int256","name":"answer","type":"int256"},{"internalType":"uint256","name":"startedAt","type":"uint256"},{"internalType":"uint256","name":"updatedAt","type":"uint256"},{"internalType":"uint80","name":"answeredInRound","type":"uint80"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"latestAnswer","outputs":[{"internalType":"int256","name":"","type":"int256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"latestRoundData","outputs":[{"internalType":"uint80","name":"roundId","type":"uint80"},{"internalType":"int256","name":"answer","type":"int256"},{"internalType":"uint256","name":"startedAt","type":"uint256"},{"internalType":"uint256","name":"updatedAt","type":"uint256"},{"internalType":"uint80","name":"answeredInRound","type":"uint80"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint80","name":"roundId","type":"uint80"}],"name":"proposedGetRoundData","outputs":[{"internalType":"uint80","name":"id","type":"uint80"},{"internalType":"int256","name":"answer","type":"int256"},{"internalType":"uint256","name":"startedAt","type":"uint256"},{"internalType":"uint256","name":"updatedAt","type":"uint256"},{"internalType":"uint80","name":"answeredInRound","type":"uint80"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"proposedLatestRoundData","outputs":[{"internalType":"uint80","name":"id","type":"uint80"},{"internalType":"int256","name":"answer","type":"int256"},{"internalType":"uint256","name":"startedAt","type":"uint256"},{"internalType":"uint256","name":"updatedAt","type":"uint256"},{"internalType":"uint80","name":"answeredInRound","type":"uint80"}],"stateMutability":"view","type":"function"},{"stateMutability":"payable","type":"receive"}]
Deployed Bytecode
0x60806040526004361061007f5760003560e01c80639a6fc8f51161004e5780639a6fc8f5146101d2578063b5ab58dc14610208578063c560e4f414610232578063feaf968c14610247576100af565b8063221d7d02146100d857806350d25bcd146101165780636001ac531461013d5780638f6b4d91146101bd576100af565b366100af576100ad7f0000000000000000000000000c466540b2ee1a31b441671eac0ca886e051e41061025c565b005b6100ad7f0000000000000000000000000c466540b2ee1a31b441671eac0ca886e051e41061025c565b3480156100e457600080fd5b506100ed610281565b6040805173ffffffffffffffffffffffffffffffffffffffff9092168252519081900360200190f35b34801561012257600080fd5b5061012b6102a5565b60408051918252519081900360200190f35b34801561014957600080fd5b506101736004803603602081101561016057600080fd5b503569ffffffffffffffffffff16610351565b604051808669ffffffffffffffffffff1681526020018581526020018481526020018381526020018269ffffffffffffffffffff1681526020019550505050505060405180910390f35b3480156101c957600080fd5b50610173610439565b3480156101de57600080fd5b50610173600480360360208110156101f557600080fd5b503569ffffffffffffffffffff16610509565b34801561021457600080fd5b5061012b6004803603602081101561022b57600080fd5b503561058e565b34801561023e57600080fd5b5061012b610646565b34801561025357600080fd5b5061017361064e565b366000803760008036600080855af13d6000803e80801561027c573d6000f35b3d6000fd5b7f0000000000000000000000000c466540b2ee1a31b441671eac0ca886e051e41081565b600063b96423a07f0000000000000000000000000c466540b2ee1a31b441671eac0ca886e051e41073ffffffffffffffffffffffffffffffffffffffff166350d25bcd6040518163ffffffff1660e01b815260040160206040518083038186803b15801561031257600080fd5b505afa158015610326573d6000803e3d6000fd5b505050506040513d602081101561033c57600080fd5b50516305f5e100028161034b57fe5b05905090565b60008060008060007f0000000000000000000000000c466540b2ee1a31b441671eac0ca886e051e41073ffffffffffffffffffffffffffffffffffffffff16636001ac53876040518263ffffffff1660e01b8152600401808269ffffffffffffffffffff16815260200191505060a06040518083038186803b1580156103d657600080fd5b505afa1580156103ea573d6000803e3d6000fd5b505050506040513d60a081101561040057600080fd5b508051602082015160408301516060840151608090940151929a63b96423a06305f5e10090930292909205995097509195509350915050565b60008060008060007f0000000000000000000000000c466540b2ee1a31b441671eac0ca886e051e41073ffffffffffffffffffffffffffffffffffffffff16638f6b4d916040518163ffffffff1660e01b815260040160a06040518083038186803b1580156104a757600080fd5b505afa1580156104bb573d6000803e3d6000fd5b505050506040513d60a08110156104d157600080fd5b508051602082015160408301516060840151608090940151929963b96423a06305f5e100909302929092059850965091945092509050565b60008060008060007f0000000000000000000000000c466540b2ee1a31b441671eac0ca886e051e41073ffffffffffffffffffffffffffffffffffffffff16639a6fc8f5876040518263ffffffff1660e01b8152600401808269ffffffffffffffffffff16815260200191505060a06040518083038186803b1580156103d657600080fd5b600063b96423a07f0000000000000000000000000c466540b2ee1a31b441671eac0ca886e051e41073ffffffffffffffffffffffffffffffffffffffff1663b5ab58dc846040518263ffffffff1660e01b81526004018082815260200191505060206040518083038186803b15801561060657600080fd5b505afa15801561061a573d6000803e3d6000fd5b505050506040513d602081101561063057600080fd5b50516305f5e100028161063f57fe5b0592915050565b63b96423a081565b60008060008060007f0000000000000000000000000c466540b2ee1a31b441671eac0ca886e051e41073ffffffffffffffffffffffffffffffffffffffff1663feaf968c6040518163ffffffff1660e01b815260040160a06040518083038186803b1580156104a757600080fdfea2646970667358221220b1d7761991cbc6753813a579c99b2537762bba5d472b2944b09daca1da5692d064736f6c63430007060033
Loading...
Loading
Loading...
Loading
Multichain Portfolio | 30 Chains
Chain | Token | Portfolio % | Price | Amount | Value |
---|
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.