From 3ecbca7daafcf35b29305e37fa74fd028ba82814 Mon Sep 17 00:00:00 2001 From: Dev Kalra Date: Fri, 15 Dec 2023 17:30:38 +0530 Subject: [PATCH] [fortuna] update config and abi (#1187) * update config and abi * introduce sepolia later * update sdk readme * fix lightlink issue * update link --- fortuna/Cargo.lock | 2 +- fortuna/Cargo.toml | 2 +- fortuna/config.yaml | 18 +- fortuna/src/abi.json | 1565 +++++++++++------ fortuna/src/chain/ethereum.rs | 3 +- .../ethereum/entropy_sdk/solidity/README.md | 10 +- 6 files changed, 1004 insertions(+), 596 deletions(-) diff --git a/fortuna/Cargo.lock b/fortuna/Cargo.lock index c61d4c72..28f718cc 100644 --- a/fortuna/Cargo.lock +++ b/fortuna/Cargo.lock @@ -1486,7 +1486,7 @@ dependencies = [ [[package]] name = "fortuna" -version = "2.0.1" +version = "3.0.1" dependencies = [ "anyhow", "axum", diff --git a/fortuna/Cargo.toml b/fortuna/Cargo.toml index 9cfb6305..5771d42a 100644 --- a/fortuna/Cargo.toml +++ b/fortuna/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "fortuna" -version = "2.0.1" +version = "3.0.1" edition = "2021" [dependencies] diff --git a/fortuna/config.yaml b/fortuna/config.yaml index 021162d0..cbfad0d4 100644 --- a/fortuna/config.yaml +++ b/fortuna/config.yaml @@ -1,18 +1,6 @@ chains: - optimism-goerli: - geth_rpc_addr: https://goerli.optimism.io - contract_addr: 0x28F16Af4D87523910b843a801454AEde5F9B0459 - reveal_delay_blocks: 0 - avalanche-fuji: - geth_rpc_addr: https://api.avax-test.network/ext/bc/C/rpc - contract_addr: 0xD42c7a708E74AD19401D907a14146F006c851Ee3 - reveal_delay_blocks: 0 - eos-evm-testnet: - geth_rpc_addr: https://api.testnet.evm.eosnetwork.com/ - contract_addr: 0xD42c7a708E74AD19401D907a14146F006c851Ee3 + lightlink_pegasus: + geth_rpc_addr: https://replicator.pegasus.lightlink.io/rpc/v1 + contract_addr: 0x8250f4aF4B972684F7b336503E2D6dFeDeB1487a reveal_delay_blocks: 0 legacy_tx: true - arbitrum-goerli: - geth_rpc_addr: https://arbitrum-goerli.publicnode.com - contract_addr: 0xd9eAcfFB8e80b7193042499485EF8369b08E85B6 - reveal_delay_blocks: 0 diff --git a/fortuna/src/abi.json b/fortuna/src/abi.json index 55d7f8bd..e373e7f6 100644 --- a/fortuna/src/abi.json +++ b/fortuna/src/abi.json @@ -1,599 +1,1020 @@ [ { - "type": "function", - "name": "NUM_REQUESTS", "inputs": [], - "outputs": [ - { - "name": "", - "type": "uint8", - "internalType": "uint8" - } - ], - "stateMutability": "view" + "stateMutability": "nonpayable", + "type": "constructor" }, { - "type": "function", - "name": "NUM_REQUESTS_MASK", "inputs": [], - "outputs": [ - { - "name": "", - "type": "bytes1", - "internalType": "bytes1" - } - ], - "stateMutability": "view" - }, - { - "type": "function", - "name": "combineRandomValues", - "inputs": [ - { - "name": "userRandomness", - "type": "bytes32", - "internalType": "bytes32" - }, - { - "name": "providerRandomness", - "type": "bytes32", - "internalType": "bytes32" - }, - { - "name": "blockHash", - "type": "bytes32", - "internalType": "bytes32" - } - ], - "outputs": [ - { - "name": "combinedRandomness", - "type": "bytes32", - "internalType": "bytes32" - } - ], - "stateMutability": "pure" - }, - { - "type": "function", - "name": "constructUserCommitment", - "inputs": [ - { - "name": "userRandomness", - "type": "bytes32", - "internalType": "bytes32" - } - ], - "outputs": [ - { - "name": "userCommitment", - "type": "bytes32", - "internalType": "bytes32" - } - ], - "stateMutability": "pure" - }, - { - "type": "function", - "name": "getAccruedPythFees", - "inputs": [], - "outputs": [ - { - "name": "accruedPythFeesInWei", - "type": "uint128", - "internalType": "uint128" - } - ], - "stateMutability": "view" - }, - { - "type": "function", - "name": "getDefaultProvider", - "inputs": [], - "outputs": [ - { - "name": "provider", - "type": "address", - "internalType": "address" - } - ], - "stateMutability": "view" - }, - { - "type": "function", - "name": "getFee", - "inputs": [ - { - "name": "provider", - "type": "address", - "internalType": "address" - } - ], - "outputs": [ - { - "name": "feeAmount", - "type": "uint128", - "internalType": "uint128" - } - ], - "stateMutability": "view" - }, - { - "type": "function", - "name": "getProviderInfo", - "inputs": [ - { - "name": "provider", - "type": "address", - "internalType": "address" - } - ], - "outputs": [ - { - "name": "info", - "type": "tuple", - "internalType": "struct EntropyStructs.ProviderInfo", - "components": [ - { - "name": "feeInWei", - "type": "uint128", - "internalType": "uint128" - }, - { - "name": "accruedFeesInWei", - "type": "uint128", - "internalType": "uint128" - }, - { - "name": "originalCommitment", - "type": "bytes32", - "internalType": "bytes32" - }, - { - "name": "originalCommitmentSequenceNumber", - "type": "uint64", - "internalType": "uint64" - }, - { - "name": "commitmentMetadata", - "type": "bytes", - "internalType": "bytes" - }, - { - "name": "uri", - "type": "bytes", - "internalType": "bytes" - }, - { - "name": "endSequenceNumber", - "type": "uint64", - "internalType": "uint64" - }, - { - "name": "sequenceNumber", - "type": "uint64", - "internalType": "uint64" - }, - { - "name": "currentCommitment", - "type": "bytes32", - "internalType": "bytes32" - }, - { - "name": "currentCommitmentSequenceNumber", - "type": "uint64", - "internalType": "uint64" - } - ] - } - ], - "stateMutability": "view" - }, - { - "type": "function", - "name": "getPythFee", - "inputs": [], - "outputs": [ - { - "name": "feeAmount", - "type": "uint128", - "internalType": "uint128" - } - ], - "stateMutability": "view" - }, - { - "type": "function", - "name": "getRequest", - "inputs": [ - { - "name": "provider", - "type": "address", - "internalType": "address" - }, - { - "name": "sequenceNumber", - "type": "uint64", - "internalType": "uint64" - } - ], - "outputs": [ - { - "name": "req", - "type": "tuple", - "internalType": "struct EntropyStructs.Request", - "components": [ - { - "name": "provider", - "type": "address", - "internalType": "address" - }, - { - "name": "sequenceNumber", - "type": "uint64", - "internalType": "uint64" - }, - { - "name": "numHashes", - "type": "uint32", - "internalType": "uint32" - }, - { - "name": "commitment", - "type": "bytes32", - "internalType": "bytes32" - }, - { - "name": "blockNumber", - "type": "uint64", - "internalType": "uint64" - }, - { - "name": "requester", - "type": "address", - "internalType": "address" - }, - { - "name": "useBlockhash", - "type": "bool", - "internalType": "bool" - } - ] - } - ], - "stateMutability": "view" - }, - { - "type": "function", - "name": "register", - "inputs": [ - { - "name": "feeInWei", - "type": "uint128", - "internalType": "uint128" - }, - { - "name": "commitment", - "type": "bytes32", - "internalType": "bytes32" - }, - { - "name": "commitmentMetadata", - "type": "bytes", - "internalType": "bytes" - }, - { - "name": "chainLength", - "type": "uint64", - "internalType": "uint64" - }, - { - "name": "uri", - "type": "bytes", - "internalType": "bytes" - } - ], - "outputs": [], - "stateMutability": "nonpayable" - }, - { - "type": "function", - "name": "request", - "inputs": [ - { - "name": "provider", - "type": "address", - "internalType": "address" - }, - { - "name": "userCommitment", - "type": "bytes32", - "internalType": "bytes32" - }, - { - "name": "useBlockHash", - "type": "bool", - "internalType": "bool" - } - ], - "outputs": [ - { - "name": "assignedSequenceNumber", - "type": "uint64", - "internalType": "uint64" - } - ], - "stateMutability": "payable" - }, - { - "type": "function", - "name": "reveal", - "inputs": [ - { - "name": "provider", - "type": "address", - "internalType": "address" - }, - { - "name": "sequenceNumber", - "type": "uint64", - "internalType": "uint64" - }, - { - "name": "userRandomness", - "type": "bytes32", - "internalType": "bytes32" - }, - { - "name": "providerRevelation", - "type": "bytes32", - "internalType": "bytes32" - } - ], - "outputs": [ - { - "name": "randomNumber", - "type": "bytes32", - "internalType": "bytes32" - } - ], - "stateMutability": "nonpayable" - }, - { - "type": "function", - "name": "withdraw", - "inputs": [ - { - "name": "amount", - "type": "uint128", - "internalType": "uint128" - } - ], - "outputs": [], - "stateMutability": "nonpayable" - }, - { - "type": "event", - "name": "Registered", - "inputs": [ - { - "name": "provider", - "type": "tuple", - "indexed": false, - "internalType": "struct EntropyStructs.ProviderInfo", - "components": [ - { - "name": "feeInWei", - "type": "uint128", - "internalType": "uint128" - }, - { - "name": "accruedFeesInWei", - "type": "uint128", - "internalType": "uint128" - }, - { - "name": "originalCommitment", - "type": "bytes32", - "internalType": "bytes32" - }, - { - "name": "originalCommitmentSequenceNumber", - "type": "uint64", - "internalType": "uint64" - }, - { - "name": "commitmentMetadata", - "type": "bytes", - "internalType": "bytes" - }, - { - "name": "uri", - "type": "bytes", - "internalType": "bytes" - }, - { - "name": "endSequenceNumber", - "type": "uint64", - "internalType": "uint64" - }, - { - "name": "sequenceNumber", - "type": "uint64", - "internalType": "uint64" - }, - { - "name": "currentCommitment", - "type": "bytes32", - "internalType": "bytes32" - }, - { - "name": "currentCommitmentSequenceNumber", - "type": "uint64", - "internalType": "uint64" - } - ] - } - ], - "anonymous": false - }, - { - "type": "event", - "name": "Requested", - "inputs": [ - { - "name": "request", - "type": "tuple", - "indexed": false, - "internalType": "struct EntropyStructs.Request", - "components": [ - { - "name": "provider", - "type": "address", - "internalType": "address" - }, - { - "name": "sequenceNumber", - "type": "uint64", - "internalType": "uint64" - }, - { - "name": "numHashes", - "type": "uint32", - "internalType": "uint32" - }, - { - "name": "commitment", - "type": "bytes32", - "internalType": "bytes32" - }, - { - "name": "blockNumber", - "type": "uint64", - "internalType": "uint64" - }, - { - "name": "requester", - "type": "address", - "internalType": "address" - }, - { - "name": "useBlockhash", - "type": "bool", - "internalType": "bool" - } - ] - } - ], - "anonymous": false - }, - { - "type": "event", - "name": "Revealed", - "inputs": [ - { - "name": "request", - "type": "tuple", - "indexed": false, - "internalType": "struct EntropyStructs.Request", - "components": [ - { - "name": "provider", - "type": "address", - "internalType": "address" - }, - { - "name": "sequenceNumber", - "type": "uint64", - "internalType": "uint64" - }, - { - "name": "numHashes", - "type": "uint32", - "internalType": "uint32" - }, - { - "name": "commitment", - "type": "bytes32", - "internalType": "bytes32" - }, - { - "name": "blockNumber", - "type": "uint64", - "internalType": "uint64" - }, - { - "name": "requester", - "type": "address", - "internalType": "address" - }, - { - "name": "useBlockhash", - "type": "bool", - "internalType": "bool" - } - ] - }, - { - "name": "userRevelation", - "type": "bytes32", - "indexed": false, - "internalType": "bytes32" - }, - { - "name": "providerRevelation", - "type": "bytes32", - "indexed": false, - "internalType": "bytes32" - }, - { - "name": "blockHash", - "type": "bytes32", - "indexed": false, - "internalType": "bytes32" - }, - { - "name": "randomNumber", - "type": "bytes32", - "indexed": false, - "internalType": "bytes32" - } - ], - "anonymous": false - }, - { - "type": "error", "name": "AssertionFailure", - "inputs": [] + "type": "error" }, { - "type": "error", + "inputs": [], + "name": "BlockhashUnavailable", + "type": "error" + }, + { + "inputs": [], "name": "IncorrectRevelation", - "inputs": [] + "type": "error" }, { - "type": "error", + "inputs": [], "name": "InsufficientFee", - "inputs": [] + "type": "error" }, { - "type": "error", + "inputs": [], + "name": "InvalidUpgradeMagic", + "type": "error" + }, + { + "inputs": [], "name": "NoSuchProvider", - "inputs": [] + "type": "error" }, { - "type": "error", + "inputs": [], "name": "NoSuchRequest", - "inputs": [] + "type": "error" }, { - "type": "error", + "inputs": [], "name": "OutOfRandomness", - "inputs": [] + "type": "error" }, { - "type": "error", + "inputs": [], "name": "Unauthorized", - "inputs": [] + "type": "error" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "previousAdmin", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "newAdmin", + "type": "address" + } + ], + "name": "AdminChanged", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "beacon", + "type": "address" + } + ], + "name": "BeaconUpgraded", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "oldImplementation", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "newImplementation", + "type": "address" + } + ], + "name": "ContractUpgraded", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "oldDefaultProvider", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "newDefaultProvider", + "type": "address" + } + ], + "name": "DefaultProviderSet", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint8", + "name": "version", + "type": "uint8" + } + ], + "name": "Initialized", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "oldAdmin", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "newAdmin", + "type": "address" + } + ], + "name": "NewAdminAccepted", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "oldAdmin", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "newAdmin", + "type": "address" + } + ], + "name": "NewAdminProposed", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "previousOwner", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "OwnershipTransferStarted", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "previousOwner", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "OwnershipTransferred", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint256", + "name": "oldPythFee", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "newPythFee", + "type": "uint256" + } + ], + "name": "PythFeeSet", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "components": [ + { + "internalType": "uint128", + "name": "feeInWei", + "type": "uint128" + }, + { + "internalType": "uint128", + "name": "accruedFeesInWei", + "type": "uint128" + }, + { + "internalType": "bytes32", + "name": "originalCommitment", + "type": "bytes32" + }, + { + "internalType": "uint64", + "name": "originalCommitmentSequenceNumber", + "type": "uint64" + }, + { + "internalType": "bytes", + "name": "commitmentMetadata", + "type": "bytes" + }, + { + "internalType": "bytes", + "name": "uri", + "type": "bytes" + }, + { + "internalType": "uint64", + "name": "endSequenceNumber", + "type": "uint64" + }, + { + "internalType": "uint64", + "name": "sequenceNumber", + "type": "uint64" + }, + { + "internalType": "bytes32", + "name": "currentCommitment", + "type": "bytes32" + }, + { + "internalType": "uint64", + "name": "currentCommitmentSequenceNumber", + "type": "uint64" + } + ], + "indexed": false, + "internalType": "struct EntropyStructs.ProviderInfo", + "name": "provider", + "type": "tuple" + } + ], + "name": "Registered", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "components": [ + { + "internalType": "address", + "name": "provider", + "type": "address" + }, + { + "internalType": "uint64", + "name": "sequenceNumber", + "type": "uint64" + }, + { + "internalType": "uint32", + "name": "numHashes", + "type": "uint32" + }, + { + "internalType": "bytes32", + "name": "commitment", + "type": "bytes32" + }, + { + "internalType": "uint64", + "name": "blockNumber", + "type": "uint64" + }, + { + "internalType": "address", + "name": "requester", + "type": "address" + }, + { + "internalType": "bool", + "name": "useBlockhash", + "type": "bool" + } + ], + "indexed": false, + "internalType": "struct EntropyStructs.Request", + "name": "request", + "type": "tuple" + } + ], + "name": "Requested", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "components": [ + { + "internalType": "address", + "name": "provider", + "type": "address" + }, + { + "internalType": "uint64", + "name": "sequenceNumber", + "type": "uint64" + }, + { + "internalType": "uint32", + "name": "numHashes", + "type": "uint32" + }, + { + "internalType": "bytes32", + "name": "commitment", + "type": "bytes32" + }, + { + "internalType": "uint64", + "name": "blockNumber", + "type": "uint64" + }, + { + "internalType": "address", + "name": "requester", + "type": "address" + }, + { + "internalType": "bool", + "name": "useBlockhash", + "type": "bool" + } + ], + "indexed": false, + "internalType": "struct EntropyStructs.Request", + "name": "request", + "type": "tuple" + }, + { + "indexed": false, + "internalType": "bytes32", + "name": "userRevelation", + "type": "bytes32" + }, + { + "indexed": false, + "internalType": "bytes32", + "name": "providerRevelation", + "type": "bytes32" + }, + { + "indexed": false, + "internalType": "bytes32", + "name": "blockHash", + "type": "bytes32" + }, + { + "indexed": false, + "internalType": "bytes32", + "name": "randomNumber", + "type": "bytes32" + } + ], + "name": "Revealed", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "implementation", + "type": "address" + } + ], + "name": "Upgraded", + "type": "event" + }, + { + "inputs": [], + "name": "NUM_REQUESTS", + "outputs": [ + { + "internalType": "uint8", + "name": "", + "type": "uint8" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "NUM_REQUESTS_MASK", + "outputs": [ + { + "internalType": "bytes1", + "name": "", + "type": "bytes1" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "acceptAdmin", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "acceptOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "userRandomness", + "type": "bytes32" + }, + { + "internalType": "bytes32", + "name": "providerRandomness", + "type": "bytes32" + }, + { + "internalType": "bytes32", + "name": "blockHash", + "type": "bytes32" + } + ], + "name": "combineRandomValues", + "outputs": [ + { + "internalType": "bytes32", + "name": "combinedRandomness", + "type": "bytes32" + } + ], + "stateMutability": "pure", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "userRandomness", + "type": "bytes32" + } + ], + "name": "constructUserCommitment", + "outputs": [ + { + "internalType": "bytes32", + "name": "userCommitment", + "type": "bytes32" + } + ], + "stateMutability": "pure", + "type": "function" + }, + { + "inputs": [], + "name": "getAccruedPythFees", + "outputs": [ + { + "internalType": "uint128", + "name": "accruedPythFeesInWei", + "type": "uint128" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "getAdmin", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "getDefaultProvider", + "outputs": [ + { + "internalType": "address", + "name": "provider", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "provider", + "type": "address" + } + ], + "name": "getFee", + "outputs": [ + { + "internalType": "uint128", + "name": "feeAmount", + "type": "uint128" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "provider", + "type": "address" + } + ], + "name": "getProviderInfo", + "outputs": [ + { + "components": [ + { + "internalType": "uint128", + "name": "feeInWei", + "type": "uint128" + }, + { + "internalType": "uint128", + "name": "accruedFeesInWei", + "type": "uint128" + }, + { + "internalType": "bytes32", + "name": "originalCommitment", + "type": "bytes32" + }, + { + "internalType": "uint64", + "name": "originalCommitmentSequenceNumber", + "type": "uint64" + }, + { + "internalType": "bytes", + "name": "commitmentMetadata", + "type": "bytes" + }, + { + "internalType": "bytes", + "name": "uri", + "type": "bytes" + }, + { + "internalType": "uint64", + "name": "endSequenceNumber", + "type": "uint64" + }, + { + "internalType": "uint64", + "name": "sequenceNumber", + "type": "uint64" + }, + { + "internalType": "bytes32", + "name": "currentCommitment", + "type": "bytes32" + }, + { + "internalType": "uint64", + "name": "currentCommitmentSequenceNumber", + "type": "uint64" + } + ], + "internalType": "struct EntropyStructs.ProviderInfo", + "name": "info", + "type": "tuple" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "getPythFee", + "outputs": [ + { + "internalType": "uint128", + "name": "feeAmount", + "type": "uint128" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "provider", + "type": "address" + }, + { + "internalType": "uint64", + "name": "sequenceNumber", + "type": "uint64" + } + ], + "name": "getRequest", + "outputs": [ + { + "components": [ + { + "internalType": "address", + "name": "provider", + "type": "address" + }, + { + "internalType": "uint64", + "name": "sequenceNumber", + "type": "uint64" + }, + { + "internalType": "uint32", + "name": "numHashes", + "type": "uint32" + }, + { + "internalType": "bytes32", + "name": "commitment", + "type": "bytes32" + }, + { + "internalType": "uint64", + "name": "blockNumber", + "type": "uint64" + }, + { + "internalType": "address", + "name": "requester", + "type": "address" + }, + { + "internalType": "bool", + "name": "useBlockhash", + "type": "bool" + } + ], + "internalType": "struct EntropyStructs.Request", + "name": "req", + "type": "tuple" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "owner", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "pendingOwner", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newAdmin", + "type": "address" + } + ], + "name": "proposeAdmin", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "proposedAdmin", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "proxiableUUID", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint128", + "name": "feeInWei", + "type": "uint128" + }, + { + "internalType": "bytes32", + "name": "commitment", + "type": "bytes32" + }, + { + "internalType": "bytes", + "name": "commitmentMetadata", + "type": "bytes" + }, + { + "internalType": "uint64", + "name": "chainLength", + "type": "uint64" + }, + { + "internalType": "bytes", + "name": "uri", + "type": "bytes" + } + ], + "name": "register", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "renounceOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "provider", + "type": "address" + }, + { + "internalType": "bytes32", + "name": "userCommitment", + "type": "bytes32" + }, + { + "internalType": "bool", + "name": "useBlockHash", + "type": "bool" + } + ], + "name": "request", + "outputs": [ + { + "internalType": "uint64", + "name": "assignedSequenceNumber", + "type": "uint64" + } + ], + "stateMutability": "payable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "provider", + "type": "address" + }, + { + "internalType": "uint64", + "name": "sequenceNumber", + "type": "uint64" + }, + { + "internalType": "bytes32", + "name": "userRandomness", + "type": "bytes32" + }, + { + "internalType": "bytes32", + "name": "providerRevelation", + "type": "bytes32" + } + ], + "name": "reveal", + "outputs": [ + { + "internalType": "bytes32", + "name": "randomNumber", + "type": "bytes32" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newDefaultProvider", + "type": "address" + } + ], + "name": "setDefaultProvider", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint128", + "name": "newPythFee", + "type": "uint128" + } + ], + "name": "setPythFee", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "transferOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint128", + "name": "amount", + "type": "uint128" + } + ], + "name": "withdraw", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "owner", + "type": "address" + }, + { + "internalType": "address", + "name": "admin", + "type": "address" + }, + { + "internalType": "uint128", + "name": "pythFeeInWei", + "type": "uint128" + }, + { + "internalType": "address", + "name": "defaultProvider", + "type": "address" + }, + { + "internalType": "bool", + "name": "prefillRequestStorage", + "type": "bool" + } + ], + "name": "initialize", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newImplementation", + "type": "address" + } + ], + "name": "upgradeTo", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newImplementation", + "type": "address" + }, + { + "internalType": "bytes", + "name": "data", + "type": "bytes" + } + ], + "name": "upgradeToAndCall", + "outputs": [], + "stateMutability": "payable", + "type": "function" + }, + { + "inputs": [], + "name": "entropyUpgradableMagic", + "outputs": [ + { + "internalType": "uint32", + "name": "", + "type": "uint32" + } + ], + "stateMutability": "pure", + "type": "function" } ] diff --git a/fortuna/src/chain/ethereum.rs b/fortuna/src/chain/ethereum.rs index 9be25b2c..183758db 100644 --- a/fortuna/src/chain/ethereum.rs +++ b/fortuna/src/chain/ethereum.rs @@ -189,7 +189,8 @@ impl EntropyReader for PythContract { ) -> Result> { let r = self .get_request(provider_address, sequence_number) - .block(ethers::core::types::BlockNumber::Finalized) + // TODO: This doesn't work for lighlink right now. Figure out how to do this in lightlink + // .block(ethers::core::types::BlockNumber::Finalized) .call() .await?; diff --git a/target_chains/ethereum/entropy_sdk/solidity/README.md b/target_chains/ethereum/entropy_sdk/solidity/README.md index f04b4ea7..bee32484 100644 --- a/target_chains/ethereum/entropy_sdk/solidity/README.md +++ b/target_chains/ethereum/entropy_sdk/solidity/README.md @@ -19,12 +19,10 @@ To use the SDK, you need the address of an Entropy contract on your blockchain a The following table lists the current deployments of entropy. ``` -| Chain | Entropy Address | Provider | -|-----------------|--------------------------------------------|--------------------------------------------| -| avalanche-fuji | 0xD42c7a708E74AD19401D907a14146F006c851Ee3 | 0x6CC14824Ea2918f5De5C2f75A9Da968ad4BD6344 | -| optimism-goerli | 0x28F16Af4D87523910b843a801454AEde5F9B0459 | 0x6CC14824Ea2918f5De5C2f75A9Da968ad4BD6344 | -| eos-evm-testnet | 0xD42c7a708E74AD19401D907a14146F006c851Ee3 | 0x6CC14824Ea2918f5De5C2f75A9Da968ad4BD6344 | -| arbitrum-goerli | 0xd9eAcfFB8e80b7193042499485EF8369b08E85B6 | 0x6CC14824Ea2918f5De5C2f75A9Da968ad4BD6344 | +| Chain | Entropy Address | Provider | +|-------------------|--------------------------------------------|--------------------------------------------| +| lightlink-pegasus | 0x8250f4aF4B972684F7b336503E2D6dFeDeB1487a | 0x6CC14824Ea2918f5De5C2f75A9Da968ad4BD6344 | + ``` Choose one of these networks and instantiate an `IEntropy` contract in your solidity contract: