@cartesi/staking-pool
Version:
PoS Staking Pools
89 lines • 9.22 kB
JSON
{
"address": "0x2AD88466E5055CbFd1eeB010E38Dcfdf8d69fA6a",
"abi": [
{
"inputs": [
{
"internalType": "address",
"name": "_oracle",
"type": "address"
}
],
"stateMutability": "nonpayable",
"type": "constructor"
},
{
"inputs": [],
"name": "getPrice",
"outputs": [
{
"internalType": "uint256",
"name": "",
"type": "uint256"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "oracle",
"outputs": [
{
"internalType": "contract AggregatorInterface",
"name": "",
"type": "address"
}
],
"stateMutability": "view",
"type": "function"
}
],
"transactionHash": "0xf2a6958e0d510d6c740ee72dd830f9ca0b5467981d7e426e7a6d57dc18b372dc",
"receipt": {
"to": null,
"from": "0x18930e8a66a1DbE21D00581216789AAB7460Afd0",
"contractAddress": "0x2AD88466E5055CbFd1eeB010E38Dcfdf8d69fA6a",
"transactionIndex": 16,
"gasUsed": "137039",
"logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
"blockHash": "0xe91291ceb9b5ff1c8570e80d5ad0dbb67637199d6de4ab0c59c7995776bfe04f",
"transactionHash": "0xf2a6958e0d510d6c740ee72dd830f9ca0b5467981d7e426e7a6d57dc18b372dc",
"logs": [],
"blockNumber": 5436051,
"cumulativeGasUsed": "2114635",
"status": 1,
"byzantium": true
},
"args": [
"0x886668810afF5fd9776CfD3D98c39a7dFF1a1BD4"
],
"solcInputHash": "74ffb08b0b6c8130de7782a186e9be4a",
"metadata": "{\"compiler\":{\"version\":\"0.8.7+commit.e28d00a7\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_oracle\",\"type\":\"address\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"inputs\":[],\"name\":\"getPrice\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"oracle\",\"outputs\":[{\"internalType\":\"contract AggregatorInterface\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"}],\"devdoc\":{\"kind\":\"dev\",\"methods\":{\"getPrice()\":{\"returns\":{\"_0\":\"value of CTSI price in ETH\"}}},\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{\"getPrice()\":{\"notice\":\"Returns latest ETH/CTSI price\"}},\"version\":1}},\"settings\":{\"compilationTarget\":{\"contracts/oracle/ChainlinkPriceOracle.sol\":\"ChainlinkPriceOracle\"},\"evmVersion\":\"london\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\",\"useLiteralContent\":true},\"optimizer\":{\"enabled\":true,\"runs\":200},\"remappings\":[]},\"sources\":{\"@chainlink/contracts/src/v0.8/interfaces/AggregatorInterface.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.0;\\n\\ninterface AggregatorInterface {\\n function latestAnswer()\\n external\\n view\\n returns (\\n int256\\n );\\n \\n function latestTimestamp()\\n external\\n view\\n returns (\\n uint256\\n );\\n\\n function latestRound()\\n external\\n view\\n returns (\\n uint256\\n );\\n\\n function getAnswer(\\n uint256 roundId\\n )\\n external\\n view\\n returns (\\n int256\\n );\\n\\n function getTimestamp(\\n uint256 roundId\\n )\\n external\\n view\\n returns (\\n uint256\\n );\\n\\n event AnswerUpdated(\\n int256 indexed current,\\n uint256 indexed roundId,\\n uint256 updatedAt\\n );\\n\\n event NewRound(\\n uint256 indexed roundId,\\n address indexed startedBy,\\n uint256 startedAt\\n );\\n}\\n\",\"keccak256\":\"0x1a5dc81544a6479f64437a8aca22c869769dd54ee3522c7ef5ebae0d329a28f0\",\"license\":\"MIT\"},\"contracts/oracle/ChainlinkPriceOracle.sol\":{\"content\":\"// Copyright 2021 Cartesi Pte. Ltd.\\n\\n// SPDX-License-Identifier: Apache-2.0\\n// Licensed under the Apache License, Version 2.0 (the \\\"License\\\"); you may not use\\n// this file except in compliance with the License. You may obtain a copy of the\\n// License at http://www.apache.org/licenses/LICENSE-2.0\\n\\n// Unless required by applicable law or agreed to in writing, software distributed\\n// under the License is distributed on an \\\"AS IS\\\" BASIS, WITHOUT WARRANTIES OR\\n// CONDITIONS OF ANY KIND, either express or implied. See the License for the\\n// specific language governing permissions and limitations under the License.\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"@chainlink/contracts/src/v0.8/interfaces/AggregatorInterface.sol\\\";\\nimport \\\"./PriceOracle.sol\\\";\\n\\ncontract ChainlinkPriceOracle is PriceOracle {\\n AggregatorInterface public immutable oracle;\\n\\n constructor(address _oracle) {\\n oracle = AggregatorInterface(_oracle);\\n }\\n\\n /// @notice Returns latest ETH/CTSI price\\n /// @return value of CTSI price in ETH\\n function getPrice() external view override returns (uint256) {\\n // get gas price from chainlink oracle\\n // https://data.chain.link/ethereum/mainnet/crypto-eth/ctsi-eth\\n return uint256(oracle.latestAnswer());\\n }\\n}\\n\",\"keccak256\":\"0xb1e9d8af087d7b3fe267d50067acd575793500bd43e1a7b6bbc6bba918b5252b\",\"license\":\"Apache-2.0\"},\"contracts/oracle/PriceOracle.sol\":{\"content\":\"// Copyright 2021 Cartesi Pte. Ltd.\\n\\n// SPDX-License-Identifier: Apache-2.0\\n// Licensed under the Apache License, Version 2.0 (the \\\"License\\\"); you may not use\\n// this file except in compliance with the License. You may obtain a copy of the\\n// License at http://www.apache.org/licenses/LICENSE-2.0\\n\\n// Unless required by applicable law or agreed to in writing, software distributed\\n// under the License is distributed on an \\\"AS IS\\\" BASIS, WITHOUT WARRANTIES OR\\n// CONDITIONS OF ANY KIND, either express or implied. See the License for the\\n// specific language governing permissions and limitations under the License.\\n\\n/// @title Interface staking contract\\npragma solidity >=0.5.0 <0.9.0;\\n\\ninterface PriceOracle {\\n /// @notice Returns price of CTSI in ETH\\n /// @return value of 1 ETH in CTSI\\n function getPrice() external view returns (uint256);\\n}\\n\",\"keccak256\":\"0xfa7ef41ddc10fbf80d09ad56eb247609ebae765ef47e74d98230b2718dba3ddb\",\"license\":\"Apache-2.0\"}},\"version\":1}",
"bytecode": "0x60a060405234801561001057600080fd5b5060405161021338038061021383398101604081905261002f91610044565b60601b6001600160601b031916608052610074565b60006020828403121561005657600080fd5b81516001600160a01b038116811461006d57600080fd5b9392505050565b60805160601c61017c61009760003960008181604001526099015261017c6000f3fe608060405234801561001057600080fd5b50600436106100365760003560e01c80637dc0d1d01461003b57806398d5fdca1461007f575b600080fd5b6100627f000000000000000000000000000000000000000000000000000000000000000081565b6040516001600160a01b0390911681526020015b60405180910390f35b610087610095565b604051908152602001610076565b60007f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03166350d25bcd6040518163ffffffff1660e01b815260040160206040518083038186803b1580156100f057600080fd5b505afa158015610104573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610128919061012d565b905090565b60006020828403121561013f57600080fd5b505191905056fea2646970667358221220b02909f3156bcd2200e9ef73f6ea4bfa95005c95ad082e65d279f20bd78ac38064736f6c63430008070033",
"deployedBytecode": "0x608060405234801561001057600080fd5b50600436106100365760003560e01c80637dc0d1d01461003b57806398d5fdca1461007f575b600080fd5b6100627f000000000000000000000000000000000000000000000000000000000000000081565b6040516001600160a01b0390911681526020015b60405180910390f35b610087610095565b604051908152602001610076565b60007f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03166350d25bcd6040518163ffffffff1660e01b815260040160206040518083038186803b1580156100f057600080fd5b505afa158015610104573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610128919061012d565b905090565b60006020828403121561013f57600080fd5b505191905056fea2646970667358221220b02909f3156bcd2200e9ef73f6ea4bfa95005c95ad082e65d279f20bd78ac38064736f6c63430008070033",
"devdoc": {
"kind": "dev",
"methods": {
"getPrice()": {
"returns": {
"_0": "value of CTSI price in ETH"
}
}
},
"version": 1
},
"userdoc": {
"kind": "user",
"methods": {
"getPrice()": {
"notice": "Returns latest ETH/CTSI price"
}
},
"version": 1
},
"storageLayout": {
"storage": [],
"types": null
}
}