generated from proofoftom/buidler-waffle-typechain-quasar
-
Notifications
You must be signed in to change notification settings - Fork 91
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
subgraph mapping for UniversalRecipientRegistry
- Loading branch information
Showing
10 changed files
with
999 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
import { ethers } from 'hardhat' | ||
import { UNIT } from '../utils/constants' | ||
import { RecipientRegistryFactory } from '../utils/recipient-registry-factory' | ||
|
||
/* | ||
* Deploy a new recipient registry. | ||
* The following environment variables must be set to run the script | ||
* | ||
* RECIPIENT_REGISTRY_TYPE - default is simple, values can be simple, optimistic, universal | ||
* FUNDING_ROUND_FACTORY_ADDRESS - address of the funding round factory | ||
* WALLET_PRIVATE_KEY - private key of the account that will fund this transaction | ||
* JSONRPC_HTTP_URL - URL to connect to the node | ||
* | ||
* For example, to run the script on rinkeby network: | ||
* From the contracts folder: | ||
* npx hardhat run --network rinkeby scripts/deployRecipientRegistry.ts | ||
* | ||
*/ | ||
async function main() { | ||
const recipientRegistryType = process.env.RECIPIENT_REGISTRY_TYPE || 'simple' | ||
const fundingRoundFactoryAddress = process.env.FUNDING_ROUND_FACTORY_ADDRESS | ||
const challengePeriodDuration = process.env.CHALLENGE_PERIOD_IN_SECONDS || 300 | ||
const baseDeposit = process.env.BASE_DEPOSIT || UNIT.div(10).toString() | ||
|
||
if (!fundingRoundFactoryAddress) { | ||
console.log('Environment variable FUNDING_ROUND_FACTORY_ADDRESS not set') | ||
return | ||
} | ||
const fundingRoundFactory = await ethers.getContractAt( | ||
'FundingRoundFactory', | ||
fundingRoundFactoryAddress | ||
) | ||
const factoryOwner = await fundingRoundFactory.owner() | ||
|
||
console.log('*******************') | ||
console.log(`Deploying a new ${recipientRegistryType} recipient registry!`) | ||
console.log(` challenge period in seconds: ${challengePeriodDuration}`) | ||
console.log(` baseDeposit ${baseDeposit}`) | ||
console.log(` fundingRoundFactoryAddress ${fundingRoundFactoryAddress}`) | ||
console.log(` fundingRoundFactoryOwner ${factoryOwner}`) | ||
const [deployer] = await ethers.getSigners() | ||
|
||
const recipientRegistry = await RecipientRegistryFactory.deploy( | ||
recipientRegistryType, | ||
{ | ||
controller: fundingRoundFactory.address, | ||
baseDeposit, | ||
challengePeriodDuration, | ||
}, | ||
deployer | ||
) | ||
console.log(` recipientRegistry address: ${recipientRegistry.address}`) | ||
|
||
const setRecipientRegistryTx = await fundingRoundFactory.setRecipientRegistry( | ||
recipientRegistry.address | ||
) | ||
|
||
await setRecipientRegistryTx.wait() | ||
console.log('*******************') | ||
} | ||
|
||
main() | ||
.then(() => process.exit(0)) | ||
.catch((error) => { | ||
console.error(error) | ||
process.exit(1) | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,243 @@ | ||
[ | ||
{ | ||
"inputs": [ | ||
{ "internalType": "uint256", "name": "_baseDeposit", "type": "uint256" }, | ||
{ | ||
"internalType": "uint256", | ||
"name": "_challengePeriodDuration", | ||
"type": "uint256" | ||
}, | ||
{ "internalType": "address", "name": "_controller", "type": "address" } | ||
], | ||
"stateMutability": "nonpayable", | ||
"type": "constructor" | ||
}, | ||
{ | ||
"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": true, | ||
"internalType": "bytes32", | ||
"name": "_recipientId", | ||
"type": "bytes32" | ||
}, | ||
{ | ||
"indexed": true, | ||
"internalType": "enum OptimisticRecipientRegistry.RequestType", | ||
"name": "_type", | ||
"type": "uint8" | ||
}, | ||
{ | ||
"indexed": true, | ||
"internalType": "bool", | ||
"name": "_rejected", | ||
"type": "bool" | ||
}, | ||
{ | ||
"indexed": false, | ||
"internalType": "uint256", | ||
"name": "_recipientIndex", | ||
"type": "uint256" | ||
}, | ||
{ | ||
"indexed": false, | ||
"internalType": "uint256", | ||
"name": "_timestamp", | ||
"type": "uint256" | ||
} | ||
], | ||
"name": "RequestResolved", | ||
"type": "event" | ||
}, | ||
{ | ||
"anonymous": false, | ||
"inputs": [ | ||
{ | ||
"indexed": true, | ||
"internalType": "bytes32", | ||
"name": "_recipientId", | ||
"type": "bytes32" | ||
}, | ||
{ | ||
"indexed": true, | ||
"internalType": "enum OptimisticRecipientRegistry.RequestType", | ||
"name": "_type", | ||
"type": "uint8" | ||
}, | ||
{ | ||
"indexed": false, | ||
"internalType": "address", | ||
"name": "_recipient", | ||
"type": "address" | ||
}, | ||
{ | ||
"indexed": false, | ||
"internalType": "string", | ||
"name": "_metadataId", | ||
"type": "string" | ||
}, | ||
{ | ||
"indexed": false, | ||
"internalType": "uint256", | ||
"name": "_timestamp", | ||
"type": "uint256" | ||
} | ||
], | ||
"name": "RequestSubmitted", | ||
"type": "event" | ||
}, | ||
{ | ||
"inputs": [ | ||
{ "internalType": "address", "name": "_recipient", "type": "address" }, | ||
{ "internalType": "string", "name": "_metadataId", "type": "string" } | ||
], | ||
"name": "addRecipient", | ||
"outputs": [], | ||
"stateMutability": "payable", | ||
"type": "function" | ||
}, | ||
{ | ||
"inputs": [], | ||
"name": "baseDeposit", | ||
"outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], | ||
"stateMutability": "view", | ||
"type": "function" | ||
}, | ||
{ | ||
"inputs": [], | ||
"name": "challengePeriodDuration", | ||
"outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], | ||
"stateMutability": "view", | ||
"type": "function" | ||
}, | ||
{ | ||
"inputs": [ | ||
{ "internalType": "bytes32", "name": "_recipientId", "type": "bytes32" }, | ||
{ | ||
"internalType": "address payable", | ||
"name": "_beneficiary", | ||
"type": "address" | ||
} | ||
], | ||
"name": "challengeRequest", | ||
"outputs": [{ "internalType": "bool", "name": "", "type": "bool" }], | ||
"stateMutability": "nonpayable", | ||
"type": "function" | ||
}, | ||
{ | ||
"inputs": [], | ||
"name": "controller", | ||
"outputs": [{ "internalType": "address", "name": "", "type": "address" }], | ||
"stateMutability": "view", | ||
"type": "function" | ||
}, | ||
{ | ||
"inputs": [ | ||
{ "internalType": "bytes32", "name": "_recipientId", "type": "bytes32" } | ||
], | ||
"name": "executeRequest", | ||
"outputs": [{ "internalType": "bool", "name": "", "type": "bool" }], | ||
"stateMutability": "nonpayable", | ||
"type": "function" | ||
}, | ||
{ | ||
"inputs": [ | ||
{ "internalType": "uint256", "name": "_index", "type": "uint256" }, | ||
{ "internalType": "uint256", "name": "_startTime", "type": "uint256" }, | ||
{ "internalType": "uint256", "name": "_endTime", "type": "uint256" } | ||
], | ||
"name": "getRecipientAddress", | ||
"outputs": [{ "internalType": "address", "name": "", "type": "address" }], | ||
"stateMutability": "view", | ||
"type": "function" | ||
}, | ||
{ | ||
"inputs": [], | ||
"name": "maxRecipients", | ||
"outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], | ||
"stateMutability": "view", | ||
"type": "function" | ||
}, | ||
{ | ||
"inputs": [], | ||
"name": "owner", | ||
"outputs": [{ "internalType": "address", "name": "", "type": "address" }], | ||
"stateMutability": "view", | ||
"type": "function" | ||
}, | ||
{ | ||
"inputs": [ | ||
{ "internalType": "bytes32", "name": "_recipientId", "type": "bytes32" } | ||
], | ||
"name": "removeRecipient", | ||
"outputs": [], | ||
"stateMutability": "payable", | ||
"type": "function" | ||
}, | ||
{ | ||
"inputs": [], | ||
"name": "renounceOwnership", | ||
"outputs": [], | ||
"stateMutability": "nonpayable", | ||
"type": "function" | ||
}, | ||
{ | ||
"inputs": [ | ||
{ "internalType": "uint256", "name": "_baseDeposit", "type": "uint256" } | ||
], | ||
"name": "setBaseDeposit", | ||
"outputs": [], | ||
"stateMutability": "nonpayable", | ||
"type": "function" | ||
}, | ||
{ | ||
"inputs": [ | ||
{ | ||
"internalType": "uint256", | ||
"name": "_challengePeriodDuration", | ||
"type": "uint256" | ||
} | ||
], | ||
"name": "setChallengePeriodDuration", | ||
"outputs": [], | ||
"stateMutability": "nonpayable", | ||
"type": "function" | ||
}, | ||
{ | ||
"inputs": [ | ||
{ "internalType": "uint256", "name": "_maxRecipients", "type": "uint256" } | ||
], | ||
"name": "setMaxRecipients", | ||
"outputs": [{ "internalType": "bool", "name": "", "type": "bool" }], | ||
"stateMutability": "nonpayable", | ||
"type": "function" | ||
}, | ||
{ | ||
"inputs": [ | ||
{ "internalType": "address", "name": "newOwner", "type": "address" } | ||
], | ||
"name": "transferOwnership", | ||
"outputs": [], | ||
"stateMutability": "nonpayable", | ||
"type": "function" | ||
} | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.