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

Contracts deployment on Gnosis Chiado #197

Merged
merged 1 commit into from
Nov 28, 2023
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
20 changes: 10 additions & 10 deletions abi/HubController.json
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,16 @@
"name": "newAssetStorageContracts",
"type": "tuple[]"
},
{
"internalType": "address[]",
"name": "newHashFunctions",
"type": "address[]"
},
{
"internalType": "address[]",
"name": "newScoreFunctions",
"type": "address[]"
},
{
"internalType": "address[]",
"name": "contractsToReinitialize",
Expand All @@ -163,16 +173,6 @@
"internalType": "struct GeneralStructs.ForwardCallInputArgs[]",
"name": "forwardCallsData",
"type": "tuple[]"
},
{
"internalType": "address[]",
"name": "newHashFunctions",
"type": "address[]"
},
{
"internalType": "address[]",
"name": "newScoreFunctions",
"type": "address[]"
}
],
"name": "setAndReinitializeContracts",
Expand Down
10 changes: 5 additions & 5 deletions contracts/v1/HubController.sol
Original file line number Diff line number Diff line change
Expand Up @@ -70,17 +70,17 @@ contract HubController is Named, Versioned, ContractStatus, Ownable {
function setAndReinitializeContracts(
GeneralStructs.Contract[] calldata newContracts,
GeneralStructs.Contract[] calldata newAssetStorageContracts,
address[] calldata contractsToReinitialize,
GeneralStructs.ForwardCallInputArgs[] calldata forwardCallsData,
address[] calldata newHashFunctions,
address[] calldata newScoreFunctions
address[] calldata newScoreFunctions,
address[] calldata contractsToReinitialize,
GeneralStructs.ForwardCallInputArgs[] calldata forwardCallsData
) external onlyOwnerOrMultiSigOwner {
_setContracts(newContracts);
_setAssetStorageContracts(newAssetStorageContracts);
_reinitializeContracts(contractsToReinitialize);
_forwardCalls(forwardCallsData);
_setHashFunctions(newHashFunctions);
_setScoreFunctions(newScoreFunctions);
_reinitializeContracts(contractsToReinitialize);
_forwardCalls(forwardCallsData);
}

function setContractAddress(
Expand Down
41 changes: 30 additions & 11 deletions deploy/003_deploy_token.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,36 @@ const func: DeployFunction = async function (hre: HardhatRuntimeEnvironment) {

const isDeployed = hre.helpers.isDeployed('Token');

const Token = await hre.helpers.deploy({
newContractName: 'Token',
passHubInConstructor: false,
additionalArgs: ['TEST TOKEN', 'TEST'],
});

if (!isDeployed) {
const setupRoleTx = await Token.setupRole(deployer, { from: deployer });
await setupRoleTx.wait();
}
if (hre.network.name === 'hardhat') {
if (isDeployed) {
const hubAddress = hre.helpers.contractDeployments.contracts['Hub'].evmAddress;
const Hub = await hre.ethers.getContractAt('Hub', hubAddress, deployer);

const tokenInHub = await Hub['isContract(string)']('Token');

if (!tokenInHub) {
const hubControllerAddress = hre.helpers.contractDeployments.contracts['HubController'].evmAddress;
const HubController = await hre.ethers.getContractAt('HubController', hubControllerAddress, deployer);

const tokenAddress = hre.helpers.contractDeployments.contracts['Token'].evmAddress;

console.log(`Setting Token (${tokenAddress}) in the Hub (${Hub.address}).`);
const setTokenTx = await HubController.setContractAddress('Token', tokenAddress);
await setTokenTx.wait();
}
} else if (!isDeployed && hre.network.name === 'hardhat') {
const Token = await hre.helpers.deploy({
newContractName: 'Token',
passHubInConstructor: false,
additionalArgs: ['TEST TOKEN', 'TEST'],
});

const minterRole = await Token.MINTER_ROLE();
if (!(await Token.hasRole(minterRole, deployer))) {
console.log(`Setting minter role for ${deployer}.`);
const setupMinterRoleTx = await Token.setupRole(deployer, { from: deployer });
await setupMinterRoleTx.wait();
}

const amountToMint = hre.ethers.utils.parseEther(`${5_000_000}`);
const accounts = await hre.ethers.getSigners();

Expand Down
4 changes: 2 additions & 2 deletions deploy/998_initialize_contracts.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,10 @@ const func: DeployFunction = async function (hre: HardhatRuntimeEnvironment) {
const setAndReinitializeContractsTx = await HubController.setAndReinitializeContracts(
newContracts,
newAssetStorageContracts,
contractsForReinitialization,
setParametersEncodedData,
newHashFunctions,
newScoreFunctions,
contractsForReinitialization,
setParametersEncodedData,
);
await setAndReinitializeContractsTx.wait();
}
Expand Down
240 changes: 240 additions & 0 deletions deployments/gnosis_chiado_dev_contracts.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,240 @@
{
"contracts": {
"Assertion": {
"deployed": true,
"deploymentTimestamp": 1701108252805,
"evmAddress": "0x2785dB031C67B17B07daB7E1e3F9690E9709B735",
"gitBranch": "main",
"gitCommitHash": "83b739de2ea02ce8027e2fccc6e04e9d5da48814",
"version": "1.0.1"
},
"AssertionStorage": {
"deployed": true,
"deploymentTimestamp": 1701108133535,
"evmAddress": "0xe8eF48a58367a5D58e5529eDa3f605B59Fd7b46c",
"gitBranch": "main",
"gitCommitHash": "83b739de2ea02ce8027e2fccc6e04e9d5da48814",
"version": "1.0.0"
},
"CommitManagerV1": {
"deployed": true,
"deploymentTimestamp": 1701108327533,
"evmAddress": "0x94218Ce6A441f027dFB08d0cAEe3A028014A70C2",
"gitBranch": "main",
"gitCommitHash": "83b739de2ea02ce8027e2fccc6e04e9d5da48814",
"version": "1.0.1"
},
"CommitManagerV1U1": {
"deployed": true,
"deploymentTimestamp": 1701108343997,
"evmAddress": "0x223A884F8a4CA10242aAC2b5a5857337764Ff805",
"gitBranch": "main",
"gitCommitHash": "83b739de2ea02ce8027e2fccc6e04e9d5da48814",
"version": "1.0.1"
},
"ContentAsset": {
"deployed": true,
"deploymentTimestamp": 1701108698623,
"evmAddress": "0xaC93381697288fBBa9C4a7ED555ca57C74f0e85B",
"gitBranch": "main",
"gitCommitHash": "83b739de2ea02ce8027e2fccc6e04e9d5da48814",
"version": "1.0.2"
},
"ContentAssetStorage": {
"deployed": true,
"deploymentTimestamp": 1701108233019,
"evmAddress": "0xB089bB3ce9af2032f1444DA18A8CF846cE4d6ec4",
"gitBranch": "main",
"gitCommitHash": "83b739de2ea02ce8027e2fccc6e04e9d5da48814",
"version": "2.0.0"
},
"HashingProxy": {
"deployed": true,
"deploymentTimestamp": 1701108085609,
"evmAddress": "0xD1a30E13DefA65684e22CC09EF51ca12D9c022C3",
"gitBranch": "main",
"gitCommitHash": "83b739de2ea02ce8027e2fccc6e04e9d5da48814",
"version": "1.0.1"
},
"Hub": {
"deployed": true,
"deploymentTimestamp": 1701108008675,
"evmAddress": "0xD2bA102A0b11944d00180eE8136208ccF87bC39A",
"gitBranch": "main",
"gitCommitHash": "83b739de2ea02ce8027e2fccc6e04e9d5da48814",
"version": "2.0.0"
},
"HubController": {
"deployed": true,
"deploymentTimestamp": 1701108018449,
"evmAddress": "0x529B84F8116031830f80a12afb10BA738596a3ff",
"gitBranch": "main",
"gitCommitHash": "83b739de2ea02ce8027e2fccc6e04e9d5da48814",
"version": "1.0.1"
},
"Identity": {
"deployed": true,
"deploymentTimestamp": 1701108258606,
"evmAddress": "0x654c24F865cd6420bEA563DE61ccf4b1C25C5EC0",
"gitBranch": "main",
"gitCommitHash": "83b739de2ea02ce8027e2fccc6e04e9d5da48814",
"version": "1.0.1"
},
"IdentityStorage": {
"deployed": true,
"deploymentTimestamp": 1701108151627,
"evmAddress": "0xf0c302F9F7DC143BedF575ad9a3697194FF1bdCf",
"gitBranch": "main",
"gitCommitHash": "83b739de2ea02ce8027e2fccc6e04e9d5da48814",
"version": "2.0.0"
},
"Log2PLDSF": {
"deployed": true,
"deploymentTimestamp": 1701108123571,
"evmAddress": "0x144D304afA78Fd7093c2257695D1633cCEfaf13E",
"gitBranch": "main",
"gitCommitHash": "83b739de2ea02ce8027e2fccc6e04e9d5da48814",
"version": null
},
"ParametersStorage": {
"deployed": true,
"deploymentTimestamp": 1701108052661,
"evmAddress": "0x4dD9339bBe3C49CF8806b7440cbc57BFC82b5ad5",
"gitBranch": "main",
"gitCommitHash": "83b739de2ea02ce8027e2fccc6e04e9d5da48814",
"version": "1.1.0"
},
"Profile": {
"deployed": true,
"deploymentTimestamp": 1701108296922,
"evmAddress": "0xC7967b6dF41CD6A331D7Bb88129c63b6bb91614e",
"gitBranch": "main",
"gitCommitHash": "83b739de2ea02ce8027e2fccc6e04e9d5da48814",
"version": "1.0.2"
},
"ProfileStorage": {
"deployed": true,
"deploymentTimestamp": 1701108187258,
"evmAddress": "0xD658511427E6B4BeCcea024832F891e398A40343",
"gitBranch": "main",
"gitCommitHash": "83b739de2ea02ce8027e2fccc6e04e9d5da48814",
"version": "1.0.0"
},
"ProofManagerV1": {
"deployed": true,
"deploymentTimestamp": 1701108333806,
"evmAddress": "0x1E83a78E12C693d0f2EB94AC51e442E0D1B63a3b",
"gitBranch": "main",
"gitCommitHash": "83b739de2ea02ce8027e2fccc6e04e9d5da48814",
"version": "1.0.2"
},
"ProofManagerV1U1": {
"deployed": true,
"deploymentTimestamp": 1701108370005,
"evmAddress": "0xD77E59D58a3020f2752B9003151B8dF22588d60F",
"gitBranch": "main",
"gitCommitHash": "83b739de2ea02ce8027e2fccc6e04e9d5da48814",
"version": "1.0.2"
},
"SHA256": {
"deployed": true,
"deploymentTimestamp": 1701108091443,
"evmAddress": "0xfE6f7Bb8Dc73b35F14C3bE12bCA424B5DA6C8d94",
"gitBranch": "main",
"gitCommitHash": "83b739de2ea02ce8027e2fccc6e04e9d5da48814",
"version": null
},
"ScoringProxy": {
"deployed": true,
"deploymentTimestamp": 1701108109320,
"evmAddress": "0x57A5FcB27C97d49578d67e2f276A82B7F61e3Af9",
"gitBranch": "main",
"gitCommitHash": "83b739de2ea02ce8027e2fccc6e04e9d5da48814",
"version": "1.0.1"
},
"ServiceAgreementStorageProxy": {
"deployed": true,
"deploymentTimestamp": 1701108223122,
"evmAddress": "0x36bE35DD8217ebb593D3507E49A7415592dAeD01",
"gitBranch": "main",
"gitCommitHash": "83b739de2ea02ce8027e2fccc6e04e9d5da48814",
"version": "1.0.0"
},
"ServiceAgreementStorageV1": {
"deployed": true,
"deploymentTimestamp": 1701108197752,
"evmAddress": "0x325460930D11036590c32AbCF2f48F3084DF37Ce",
"gitBranch": "main",
"gitCommitHash": "83b739de2ea02ce8027e2fccc6e04e9d5da48814",
"version": "1.0.0"
},
"ServiceAgreementStorageV1U1": {
"deployed": true,
"deploymentTimestamp": 1701108207929,
"evmAddress": "0x08e5D73aa61a6F68199601B72bAC188fe08E2908",
"gitBranch": "main",
"gitCommitHash": "83b739de2ea02ce8027e2fccc6e04e9d5da48814",
"version": "1.0.0"
},
"ServiceAgreementV1": {
"deployed": true,
"deploymentTimestamp": 1701108691794,
"evmAddress": "0x7e37087595f31a15c3BFc325104e3FaE08ac730f",
"gitBranch": "main",
"gitCommitHash": "83b739de2ea02ce8027e2fccc6e04e9d5da48814",
"version": "1.1.1"
},
"ShardingTable": {
"deployed": true,
"deploymentTimestamp": 1701108272713,
"evmAddress": "0xBBd73E52Bc29678c7b4Df53F50162BB0cAc5D7Db",
"gitBranch": "main",
"gitCommitHash": "83b739de2ea02ce8027e2fccc6e04e9d5da48814",
"version": "1.0.1"
},
"ShardingTableStorage": {
"deployed": true,
"deploymentTimestamp": 1701108162127,
"evmAddress": "0x42232C6A2C4230B56c5DDc3536aaaFa4F6f97E2E",
"gitBranch": "main",
"gitCommitHash": "83b739de2ea02ce8027e2fccc6e04e9d5da48814",
"version": "1.0.0"
},
"Staking": {
"deployed": true,
"deploymentTimestamp": 1701108286747,
"evmAddress": "0xf73bd80B7B05575DDd79247eEA644E030094a47B",
"gitBranch": "main",
"gitCommitHash": "83b739de2ea02ce8027e2fccc6e04e9d5da48814",
"version": "1.0.2"
},
"StakingStorage": {
"deployed": true,
"deploymentTimestamp": 1701108180122,
"evmAddress": "0x5dC1195A8AFA9b4Ba86D2BaF6908897031d70195",
"gitBranch": "main",
"gitCommitHash": "83b739de2ea02ce8027e2fccc6e04e9d5da48814",
"version": "1.0.0"
},
"Token": {
"deployed": true,
"evmAddress": "0xEbe6b58943289617dB514de43d95f613bb2f1Ed1"
},
"UnfinalizedStateStorage": {
"deployed": true,
"deploymentTimestamp": 1701108247041,
"evmAddress": "0xFfFEfacaAd3d834CB39e17bfd99076e200Ae4D46",
"gitBranch": "main",
"gitCommitHash": "83b739de2ea02ce8027e2fccc6e04e9d5da48814",
"version": "1.0.0"
},
"WhitelistStorage": {
"deployed": true,
"deploymentTimestamp": 1701108074838,
"evmAddress": "0xF8219F07fC5682992138a75809d8268930939D96",
"gitBranch": "main",
"gitCommitHash": "83b739de2ea02ce8027e2fccc6e04e9d5da48814",
"version": "1.0.0"
}
}
}
Loading