Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ReimbursementPool on Polygon Mainnet #329

Merged
merged 6 commits into from
Sep 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion contracts/contracts/coordination/ReimbursementPool.sol
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
// SPDX-License-Identifier: GPL-3.0-only
// TODO: What about license? Original is GPL but ours is AGPL

pragma solidity ^0.8.0;

Expand All @@ -10,6 +9,7 @@ import "./IReimbursementPool.sol";
/**
* @title ReimbursementPool contract
* @dev Original source: https://github.com/keep-network/keep-core/blob/main/solidity/random-beacon/contracts/ReimbursementPool.sol
* @author Dmitry Paremski (@dimpar), Piotr Dyraga (@pdyraga)
*/
contract ReimbursementPool is Ownable, ReentrancyGuard, IReimbursementPool {
/// @notice Authorized contracts that can interact with the reimbursment pool.
Expand Down
343 changes: 343 additions & 0 deletions deployment/artifacts/mainnet.json
Original file line number Diff line number Diff line change
Expand Up @@ -4946,6 +4946,349 @@
"block_number": 50816123,
"deployer": "0x1591165F1BF8B73de7053A6BE6f239BC15076879"
},
"ReimbursementPool": {
"address": "0x65849eaDc5cE348EaA131Fdbd35aeC9235688EEB",
"abi": [
{
"type": "constructor",
"stateMutability": "nonpayable",
"inputs": [
{
"name": "_staticGas",
"type": "uint256",
"internalType": "uint256"
},
{
"name": "_maxGasPrice",
"type": "uint256",
"internalType": "uint256"
}
]
},
{
"type": "error",
"name": "OwnableInvalidOwner",
"inputs": [
{
"name": "owner",
"type": "address",
"internalType": "address"
}
]
},
{
"type": "error",
"name": "OwnableUnauthorizedAccount",
"inputs": [
{
"name": "account",
"type": "address",
"internalType": "address"
}
]
},
{
"type": "error",
"name": "ReentrancyGuardReentrantCall",
"inputs": []
},
{
"type": "event",
"name": "AuthorizedContract",
"inputs": [
{
"name": "thirdPartyContract",
"type": "address",
"internalType": "address",
"indexed": false
}
],
"anonymous": false
},
{
"type": "event",
"name": "FundsWithdrawn",
"inputs": [
{
"name": "withdrawnAmount",
"type": "uint256",
"internalType": "uint256",
"indexed": false
},
{
"name": "receiver",
"type": "address",
"internalType": "address",
"indexed": false
}
],
"anonymous": false
},
{
"type": "event",
"name": "MaxGasPriceUpdated",
"inputs": [
{
"name": "newMaxGasPrice",
"type": "uint256",
"internalType": "uint256",
"indexed": false
}
],
"anonymous": false
},
{
"type": "event",
"name": "OwnershipTransferred",
"inputs": [
{
"name": "previousOwner",
"type": "address",
"internalType": "address",
"indexed": true
},
{
"name": "newOwner",
"type": "address",
"internalType": "address",
"indexed": true
}
],
"anonymous": false
},
{
"type": "event",
"name": "SendingEtherFailed",
"inputs": [
{
"name": "refundAmount",
"type": "uint256",
"internalType": "uint256",
"indexed": false
},
{
"name": "receiver",
"type": "address",
"internalType": "address",
"indexed": false
}
],
"anonymous": false
},
{
"type": "event",
"name": "StaticGasUpdated",
"inputs": [
{
"name": "newStaticGas",
"type": "uint256",
"internalType": "uint256",
"indexed": false
}
],
"anonymous": false
},
{
"type": "event",
"name": "UnauthorizedContract",
"inputs": [
{
"name": "thirdPartyContract",
"type": "address",
"internalType": "address",
"indexed": false
}
],
"anonymous": false
},
{
"type": "function",
"name": "authorize",
"stateMutability": "nonpayable",
"inputs": [
{
"name": "_contract",
"type": "address",
"internalType": "address"
}
],
"outputs": []
},
{
"type": "function",
"name": "isAuthorized",
"stateMutability": "view",
"inputs": [
{
"name": "",
"type": "address",
"internalType": "address"
}
],
"outputs": [
{
"name": "",
"type": "bool",
"internalType": "bool"
}
]
},
{
"type": "function",
"name": "maxGasPrice",
"stateMutability": "view",
"inputs": [],
"outputs": [
{
"name": "",
"type": "uint256",
"internalType": "uint256"
}
]
},
{
"type": "function",
"name": "owner",
"stateMutability": "view",
"inputs": [],
"outputs": [
{
"name": "",
"type": "address",
"internalType": "address"
}
]
},
{
"type": "function",
"name": "refund",
"stateMutability": "nonpayable",
"inputs": [
{
"name": "gasSpent",
"type": "uint256",
"internalType": "uint256"
},
{
"name": "receiver",
"type": "address",
"internalType": "address"
}
],
"outputs": []
},
{
"type": "function",
"name": "renounceOwnership",
"stateMutability": "nonpayable",
"inputs": [],
"outputs": []
},
{
"type": "function",
"name": "setMaxGasPrice",
"stateMutability": "nonpayable",
"inputs": [
{
"name": "_maxGasPrice",
"type": "uint256",
"internalType": "uint256"
}
],
"outputs": []
},
{
"type": "function",
"name": "setStaticGas",
"stateMutability": "nonpayable",
"inputs": [
{
"name": "_staticGas",
"type": "uint256",
"internalType": "uint256"
}
],
"outputs": []
},
{
"type": "function",
"name": "staticGas",
"stateMutability": "view",
"inputs": [],
"outputs": [
{
"name": "",
"type": "uint256",
"internalType": "uint256"
}
]
},
{
"type": "function",
"name": "transferOwnership",
"stateMutability": "nonpayable",
"inputs": [
{
"name": "newOwner",
"type": "address",
"internalType": "address"
}
],
"outputs": []
},
{
"type": "function",
"name": "unauthorize",
"stateMutability": "nonpayable",
"inputs": [
{
"name": "_contract",
"type": "address",
"internalType": "address"
}
],
"outputs": []
},
{
"type": "function",
"name": "withdraw",
"stateMutability": "nonpayable",
"inputs": [
{
"name": "amount",
"type": "uint256",
"internalType": "uint256"
},
{
"name": "receiver",
"type": "address",
"internalType": "address"
}
],
"outputs": []
},
{
"type": "function",
"name": "withdrawAll",
"stateMutability": "nonpayable",
"inputs": [
{
"name": "receiver",
"type": "address",
"internalType": "address"
}
],
"outputs": []
},
{
"type": "receive",
"stateMutability": "payable"
}
],
"tx_hash": "0x0d7daede5ac88a093b3da7d0428c5753e01a04d7ab9f8c9533d1893c1682d776",
"block_number": 61687846,
"deployer": "0x1591165F1BF8B73de7053A6BE6f239BC15076879"
},
"SubscriptionManager": {
"address": "0xB0194073421192F6Cf38d72c791Be8729721A0b3",
"abi": [
Expand Down
21 changes: 21 additions & 0 deletions deployment/constructor_params/mainnet/reimbursement-pool.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
deployment:
name: reimbursement-mainnet
chain_id: 137

artifacts:
dir: ./deployment/artifacts/
filename: reimbursement-mainnet.json

constants:
# Approx avg cost according to Keep tests (see e.g. https://github.com/keep-network/keep-core/actions/runs/10783327230/job/29905024826).
# Also current value used for tBTC ReimbursementPool on Ethereum Mainnet (see https://etherscan.io/address/0x8adF3f35dBE4026112bCFc078872bcb967732Ea8#readContract#F4)
STATIC_GAS: 40800
# 110 gwei, so we cap refunds for each 30-size ritual to 10 POL (0.33 POL per node)
MAX_GAS_PRICE: 110000000000

contracts:
- ReimbursementPool:
constructor:
_staticGas: $STATIC_GAS
_maxGasPrice: $MAX_GAS_PRICE

Loading
Loading