Overview
S Balance
S 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 0xE9f605cC...174A63055 The constructor portion of the code might be different and could alter the actual behaviour of the contract
Contract Name:
ChainlinkPriceFeedMock
Compiler Version
v0.8.28+commit.7893614a
Optimization Enabled:
Yes with 200 runs
Other Settings:
shanghai EvmVersion
Contract Source Code (Solidity Standard Json-Input format)
// SPDX-License-Identifier: MIT pragma solidity 0.8.28; import "@chainlink/contracts/src/v0.8/interfaces/AggregatorV3Interface.sol"; /* * A Mocker contract that returns multiplied answer every X blocks as set by values */ contract ChainlinkPriceFeedMock is AggregatorV3Interface { // mocked values returned by contract: uint80 internal s_roundId; int256 internal s_answer; uint256 internal s_startedAt; uint256 internal s_updatedAt; uint80 internal s_answeredInRound; // stepChange - added to base value multiplied by ( blocks changed / stepBlocks) to set a pace to change. int256 internal s_stepChange; // stepBlocks - sets the pace of value change, the amounts of blocks between every change applied to value. uint256 internal s_stepBlocks; // block - the block at the last time the values were changed, where we start the count from. uint256 internal s_block; constructor( uint80 roundId, int256 answer, uint256 startedAt, uint256 updatedAt, uint80 answeredInRound, int256 stepChange, uint256 stepBlocks ) public { s_roundId = roundId; s_answer = answer; s_startedAt = startedAt; s_updatedAt = updatedAt; s_answeredInRound = answeredInRound; s_stepChange = stepChange; s_stepBlocks = stepBlocks; s_block = block.number; } // Used to modoify mocking values function setValues( uint80 roundId, int256 answer, uint256 startedAt, uint256 updatedAt, uint80 answeredInRound, int256 stepChange, uint256 stepBlocks ) public { s_roundId = roundId; s_answer = answer; s_startedAt = startedAt; s_updatedAt = updatedAt; s_answeredInRound = answeredInRound; s_stepChange = stepChange; s_stepBlocks = stepBlocks; s_block = block.number; } /* Implement AggregatorV3Interface: */ function decimals() public pure override returns (uint8) { return 0; } function description() public pure override returns (string memory) { return "voltaile value aggregator mocker"; } function version() public pure override returns (uint256) { return 0; } function getRoundData( uint80 _roundId ) public view override returns (uint80 roundId, int256 answer, uint256 startedAt, uint256 updatedAt, uint80 answeredInRound) { int256 direction = 1; bool NegativeCycle = ((block.number - s_block) % (2 * s_stepBlocks)) > s_stepBlocks; if (NegativeCycle) { direction = -1; } int256 pace = 0; if (s_stepBlocks != 0) { pace = int256(((block.number - s_block) / s_stepBlocks)); } int256 mocked_answer = s_answer + direction * s_stepChange * pace; return (_roundId, mocked_answer, s_startedAt, s_updatedAt, s_answeredInRound); } function latestRoundData() public view override returns (uint80 roundId, int256 answer, uint256 startedAt, uint256 updatedAt, uint80 answeredInRound) { int256 mocked_answer = s_answer; if (s_stepBlocks != 0) { mocked_answer = s_answer + s_stepChange * int256(((block.number - s_block) / s_stepBlocks)); } return (s_roundId, mocked_answer, s_startedAt, s_updatedAt, s_answeredInRound); } }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; interface AggregatorV3Interface { function decimals() external view returns (uint8); function description() external view returns (string memory); function version() external view returns (uint256); function getRoundData(uint80 _roundId) external view returns ( uint80 roundId, int256 answer, uint256 startedAt, uint256 updatedAt, uint80 answeredInRound ); function latestRoundData() external view returns ( uint80 roundId, int256 answer, uint256 startedAt, uint256 updatedAt, uint80 answeredInRound ); }
{ "remappings": [ "@aave/=node_modules/@aave/", "@account-abstraction/=node_modules/@account-abstraction/", "@chainlink/=node_modules/@chainlink/", "@eth-optimism/=node_modules/@chainlink/contracts/node_modules/@eth-optimism/", "@openzeppelin/=node_modules/@openzeppelin/", "@uniswap/=node_modules/@uniswap/", "base64-sol/=node_modules/base64-sol/", "ds-test/=lib/ds-test/", "eth-gas-reporter/=node_modules/eth-gas-reporter/", "forge-std/=lib/forge-std/src/", "hardhat/=node_modules/hardhat/", "solidity-bytes-utils/=node_modules/solidity-bytes-utils/", "erc4626-tests/=lib/openzeppelin-contracts-upgradeable/lib/erc4626-tests/", "openzeppelin-contracts-upgradeable/=lib/openzeppelin-contracts-upgradeable/", "openzeppelin/=lib/openzeppelin-contracts-upgradeable/contracts/", "solmate/=lib/solmate/src/", "abdk-libraries-solidity/=node_modules/abdk-libraries-solidity/" ], "optimizer": { "enabled": true, "runs": 200 }, "metadata": { "useLiteralContent": false, "bytecodeHash": "ipfs", "appendCBOR": true }, "outputSelection": { "*": { "*": [ "evm.bytecode", "evm.deployedBytecode", "devdoc", "userdoc", "metadata", "abi" ] } }, "evmVersion": "shanghai", "viaIR": true, "libraries": {} }
Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
[{"inputs":[{"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"},{"internalType":"int256","name":"stepChange","type":"int256"},{"internalType":"uint256","name":"stepBlocks","type":"uint256"}],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[],"name":"decimals","outputs":[{"internalType":"uint8","name":"","type":"uint8"}],"stateMutability":"pure","type":"function"},{"inputs":[],"name":"description","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"pure","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":"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"},{"internalType":"int256","name":"answer","type":"int256"},{"internalType":"uint256","name":"startedAt","type":"uint256"},{"internalType":"uint256","name":"updatedAt","type":"uint256"},{"internalType":"uint80","name":"answeredInRound","type":"uint80"},{"internalType":"int256","name":"stepChange","type":"int256"},{"internalType":"uint256","name":"stepBlocks","type":"uint256"}],"name":"setValues","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"version","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"pure","type":"function"}]
Deployed Bytecode
0x6080806040526004361015610012575f80fd5b5f3560e01c9081632ea92180146102d3578163313ce567146102bb5750806354fd4d50146102a15780637284e416146101e95780639a6fc8f5146100eb5763feaf968c1461005e575f80fd5b346100e7575f3660031901126100e757600154600654806100b5575b505f54600254600354600454604080516001600160501b0395861681526020810196909652850192909252606084015216608082015260a090f35b906100db6100e1926100d5600554916100d060075443610366565b610373565b9061037d565b9061039f565b5f61007a565b5f80fd5b346100e75760203660031901126100e757610104610350565b60016007546101138143610366565b600654600181901b93909290916001600160ff1b03841684036101d55784156101c15761016794849106116101b8575b6100db91925f91816101a2575b5050610162600154936005549061037d565b61037d565b600254600354600454604080516001600160501b0396871681526020810195909552840192909252606083015291909116608082015260a090f35b6101b192506100d09043610366565b8580610150565b5f199150610143565b634e487b7160e01b5f52601260045260245ffd5b634e487b7160e01b5f52601160045260245ffd5b346100e7575f3660031901126100e7576040516040810181811067ffffffffffffffff82111761028d57604052602081527f766f6c7461696c652076616c75652061676772656761746f72206d6f636b657260208201526040519060208252818151918260208301525f5b838110610275575050815f6040809484010152601f80199101168101030190f35b60208282018101516040878401015285935001610254565b634e487b7160e01b5f52604160045260245ffd5b346100e7575f3660031901126100e75760206040515f8152f35b346100e7575f3660031901126100e757805f60209252f35b346100e75760e03660031901126100e7576102ec610350565b608435906001600160501b0382168092036100e7576001600160501b03166001600160501b03195f5416175f556024356001556044356002556064356003556001600160501b0319600454161760045560a43560055560c435600655436007555f80f35b600435906001600160501b03821682036100e757565b919082039182116101d557565b81156101c1570490565b81810292915f8212600160ff1b8214166101d55781840514901517156101d557565b9190915f83820193841291129080158216911516176101d55756fea2646970667358221220d26039448744f0fc3b4d098d54a5a9ef76b613f1825eebef8dea5241792f428d64736f6c634300081c0033
Loading...
Loading
Loading...
Loading
Multichain Portfolio | 31 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.