APE Price: $1.15 (+0.33%)

Contract

0xc3214dd44B96FC1A66A6f05A121534B62713fF25

Overview

APE Balance

Apechain LogoApechain LogoApechain Logo0 APE

APE Value

$0.00

Multichain Info

No addresses found
Transaction Hash
Method
Block
From
To
0x60a0604046080192024-11-18 20:25:4721 hrs ago1731961547IN
 Create: Api3AggregatorAdaptor
0 APE0.0047708725.42069

Parent Transaction Hash Block From To
View All Internal Transactions

Loading...
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
Api3AggregatorAdaptor

Compiler Version
v0.8.17+commit.8df45f5f

Optimization Enabled:
Yes with 200 runs

Other Settings:
default evmVersion
File 1 of 2 : Api3AggregatorAdaptor.sol
// SPDX-License-Identifier: MIT
pragma solidity 0.8.17;

import "./interfaces/IProxy.sol";

contract Api3AggregatorAdaptor {  

   // Updating the proxy address is a security-critical action which is why
   // we have made it immutable.
   address public immutable proxy;

   constructor(address _proxy) {
       proxy = _proxy;
   }

    function latestAnswer() external view returns (int256 value) {
        (int256 rawValue, ) = readDataFeed();
        value = rawValue / 1e10;
    }

   function latestTimestamp() external view returns (uint256 timestamp) {
       ( , timestamp) = readDataFeed();
   }
   
   function decimals() external view returns (uint8) {
       return 8;
   }

   function readDataFeed()
       internal
       view
       returns (int224 value, uint256 timestamp)
   {
       (value, timestamp) = IProxy(proxy).read();
       // If you have any assumptions about `value` and `timestamp`, make sure
       // to validate them right after reading from the proxy. For example,
       // if the value you are reading is the spot price of an asset, you may
       // want to reject non-positive values...
       // require(value > 0, "Value not positive");
       // ...and if the data feed is being updated with a one day-heartbeat
       // interval, you may want to check for that.
       // require(
       //     timestamp + 1 days > block.timestamp,
       //     "Timestamp older than one day"
       // );
       // Try to be strict about validations, but be wary of:
       // (1) Overly strict validation that may invalidate valid values
       // (2) Mutable validation parameters that are controlled by a trusted
       // party (eliminates the trust-minimization guarantees of first-party
       // oracles)
       // (3) Validation parameters that need to be tuned according to
       // external conditions (if these are forgotten to be handled, it will
       // result in (1), look up the Venus Protocol exploit related to LUNA)

       // After validation, you can implement your contract logic here.
   }       

   function getTokenType() external pure returns (uint256) {
       return 1;
   }    
}

File 2 of 2 : IProxy.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;

/// @dev See DapiProxy.sol for comments about usage
interface IProxy {
    function read() external view returns (int224 value, uint32 timestamp);

    function api3ServerV1() external view returns (address);
}

Settings
{
  "optimizer": {
    "enabled": true,
    "runs": 200
  },
  "outputSelection": {
    "*": {
      "*": [
        "evm.bytecode",
        "evm.deployedBytecode",
        "devdoc",
        "userdoc",
        "metadata",
        "abi"
      ]
    }
  },
  "libraries": {}
}

Contract Security Audit

Contract ABI

[{"inputs":[{"internalType":"address","name":"_proxy","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[],"name":"decimals","outputs":[{"internalType":"uint8","name":"","type":"uint8"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getTokenType","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"pure","type":"function"},{"inputs":[],"name":"latestAnswer","outputs":[{"internalType":"int256","name":"value","type":"int256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"latestTimestamp","outputs":[{"internalType":"uint256","name":"timestamp","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"proxy","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"}]

60a060405234801561001057600080fd5b506040516102f83803806102f883398101604081905261002f91610040565b6001600160a01b0316608052610070565b60006020828403121561005257600080fd5b81516001600160a01b038116811461006957600080fd5b9392505050565b608051610267610091600039600081816093015261010f01526102676000f3fe608060405234801561001057600080fd5b50600436106100575760003560e01c8063313ce5671461005c57806350d25bcd146100705780638205bf6a14610086578063ec5568891461008e578063fcab1819146100cd575b600080fd5b604051600881526020015b60405180910390f35b6100786100d4565b604051908152602001610067565b6100786100fa565b6100b57f000000000000000000000000000000000000000000000000000000000000000081565b6040516001600160a01b039091168152602001610067565b6001610078565b6000806100df61010a565b50601b0b90506100f46402540be4008261019e565b91505090565b600061010461010a565b92915050565b6000807f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03166357de26a46040518163ffffffff1660e01b81526004016040805180830381865afa15801561016a573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061018e91906101e8565b909363ffffffff90911692509050565b6000826101bb57634e487b7160e01b600052601260045260246000fd5b600160ff1b8214600019841416156101e357634e487b7160e01b600052601160045260246000fd5b500590565b600080604083850312156101fb57600080fd5b825180601b0b811461020c57600080fd5b602084015190925063ffffffff8116811461022657600080fd5b80915050925092905056fea264697066735822122017babb601338cf872c702962704f088481a38c0d82b99ae03b2c99fa545bfb9c64736f6c634300081100330000000000000000000000002af47a886dbd533ccbe8a51c36a023850e2910c0

Deployed Bytecode

0x608060405234801561001057600080fd5b50600436106100575760003560e01c8063313ce5671461005c57806350d25bcd146100705780638205bf6a14610086578063ec5568891461008e578063fcab1819146100cd575b600080fd5b604051600881526020015b60405180910390f35b6100786100d4565b604051908152602001610067565b6100786100fa565b6100b57f0000000000000000000000002af47a886dbd533ccbe8a51c36a023850e2910c081565b6040516001600160a01b039091168152602001610067565b6001610078565b6000806100df61010a565b50601b0b90506100f46402540be4008261019e565b91505090565b600061010461010a565b92915050565b6000807f0000000000000000000000002af47a886dbd533ccbe8a51c36a023850e2910c06001600160a01b03166357de26a46040518163ffffffff1660e01b81526004016040805180830381865afa15801561016a573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061018e91906101e8565b909363ffffffff90911692509050565b6000826101bb57634e487b7160e01b600052601260045260246000fd5b600160ff1b8214600019841416156101e357634e487b7160e01b600052601160045260246000fd5b500590565b600080604083850312156101fb57600080fd5b825180601b0b811461020c57600080fd5b602084015190925063ffffffff8116811461022657600080fd5b80915050925092905056fea264697066735822122017babb601338cf872c702962704f088481a38c0d82b99ae03b2c99fa545bfb9c64736f6c63430008110033

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

0000000000000000000000002af47a886dbd533ccbe8a51c36a023850e2910c0

-----Decoded View---------------
Arg [0] : _proxy (address): 0x2af47a886dbD533CcbE8A51C36A023850e2910C0

-----Encoded View---------------
1 Constructor Arguments found :
Arg [0] : 0000000000000000000000002af47a886dbd533ccbe8a51c36a023850e2910c0


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