Skip to content

Commit

Permalink
Reverted back setting of the Hash/Score functions in the Hub, fixed t…
Browse files Browse the repository at this point in the history
…ests, redeployed SHA256 and Log2PLDSF on Gnosis Mainnet
  • Loading branch information
u-hubar committed Dec 19, 2023
1 parent e134731 commit 1c8489b
Show file tree
Hide file tree
Showing 6 changed files with 28 additions and 30 deletions.
1 change: 0 additions & 1 deletion deploy/007_deploy_sha256.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ const func: DeployFunction = async function (hre: HardhatRuntimeEnvironment) {
const SHA256 = await hre.helpers.deploy({
newContractName: 'SHA256',
passHubInConstructor: false,
setContractInHub: false,
});

if (!isDeployed) {
Expand Down
1 change: 0 additions & 1 deletion deploy/009_deploy_log2pldsf.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ const func: DeployFunction = async function (hre: HardhatRuntimeEnvironment) {

const Log2PLDSF = await hre.helpers.deploy({
newContractName: 'Log2PLDSF',
setContractInHub: false,
});

if (!isDeployed) {
Expand Down
26 changes: 15 additions & 11 deletions deploy/019_deploy_content_asset_storage_v2.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ const func: DeployFunction = async function (hre: HardhatRuntimeEnvironment) {

console.log('Deploying ContentAssetStorage V2...');

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

const ContentAssetStorage = await hre.helpers.deploy({
newContractName: 'ContentAssetStorageV2',
newContractNameInHub: 'ContentAssetStorage',
Expand All @@ -20,20 +22,22 @@ const func: DeployFunction = async function (hre: HardhatRuntimeEnvironment) {
setAssetStorageInHub: true,
});

const encodedData = ContentAssetStorage.interface.encodeFunctionData('setBaseURI', [
`did:dkg:${hre.network.name.split('_')[0]}:${hre.network.config.chainId}/${ContentAssetStorage.address}/`,
]);
if (!isDeployed) {
const encodedData = ContentAssetStorage.interface.encodeFunctionData('setBaseURI', [
`did:dkg:${hre.network.name.split('_')[0]}:${hre.network.config.chainId}/${ContentAssetStorage.address}/`,
]);

if (hre.network.config.environment == 'development') {
const { deployer } = await hre.getNamedAccounts();
if (hre.network.config.environment === 'development') {
const { deployer } = await hre.getNamedAccounts();

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

const setBaseURITx = await HubController.forwardCall(ContentAssetStorage.address, encodedData);
await setBaseURITx.wait();
} else {
hre.helpers.setParametersEncodedData.push(['ContentAssetStorage', [encodedData]]);
const setBaseURITx = await HubController.forwardCall(ContentAssetStorage.address, encodedData);
await setBaseURITx.wait();
} else {
hre.helpers.setParametersEncodedData.push(['ContentAssetStorage', [encodedData]]);
}
}
};

Expand Down
16 changes: 8 additions & 8 deletions deployments/gnosis_mainnet_contracts.json
Original file line number Diff line number Diff line change
Expand Up @@ -90,10 +90,10 @@
},
"Log2PLDSF": {
"deployed": true,
"deploymentTimestamp": 1703022975903,
"evmAddress": "0x7A1a6f2262da962E2f0c2117668C8b03976C43FF",
"gitBranch": "main",
"gitCommitHash": "c993c8564d17e5b8fbab770b020d7c926608ea24",
"deploymentTimestamp": 1703025999344,
"evmAddress": "0xcA9f750Cd07ACd2F1Ca9cB1d1Dfdcf19e2E9773e",
"gitBranch": "gnosis-mainnet-deployment",
"gitCommitHash": "e1347318d5badad802c1b802f3aa270be7843e26",
"version": null
},
"ParametersStorage": {
Expand Down Expand Up @@ -138,10 +138,10 @@
},
"SHA256": {
"deployed": true,
"deploymentTimestamp": 1703022954842,
"evmAddress": "0xDD21D2607D3f7e0fe939D25200f0256Cb7C7C9F7",
"gitBranch": "main",
"gitCommitHash": "c993c8564d17e5b8fbab770b020d7c926608ea24",
"deploymentTimestamp": 1703025987942,
"evmAddress": "0x01BF84f88861294Dc6FcAF14f6cAA9FAe604A528",
"gitBranch": "gnosis-mainnet-deployment",
"gitCommitHash": "e1347318d5badad802c1b802f3aa270be7843e26",
"version": null
},
"ScoringProxy": {
Expand Down
12 changes: 4 additions & 8 deletions test/v1/unit/HubController.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,6 @@ type HubControllerFixture = {
};

describe('@v1 @unit HubController contract', function () {
this.timeout(1000000);

let accounts: SignerWithAddress[];
let HubController: HubController;
let Profile: Profile;
Expand Down Expand Up @@ -125,13 +123,9 @@ describe('@v1 @unit HubController contract', function () {
const SHA256 = await hre.helpers.deploy({
newContractName: 'SHA256',
passHubInConstructor: false,
setContractInHub: false,
});
const ScoringProxy = await hre.helpers.deploy({ newContractName: 'ScoringProxy' });
const Log2PLDSF = await hre.helpers.deploy({
newContractName: 'Log2PLDSF',
setContractInHub: false,
});
const Log2PLDSF = await hre.helpers.deploy({ newContractName: 'Log2PLDSF' });
const AssertionStorage = await hre.helpers.deploy({ newContractName: 'AssertionStorage' });
const IdentityStorage = await hre.helpers.deploy({ newContractName: 'IdentityStorage' });
const ShardingTableStorage = await hre.helpers.deploy({ newContractName: 'ShardingTableStorage' });
Expand Down Expand Up @@ -164,7 +158,9 @@ describe('@v1 @unit HubController contract', function () {
{ name: 'ParametersStorage', addr: ParametersStorage.address },
{ name: 'WhitelistStorage', addr: WhitelistStorage.address },
{ name: 'HashingProxy', addr: HashingProxy.address },
{ name: 'SHA256', addr: SHA256.address },
{ name: 'ScoringProxy', addr: ScoringProxy.address },
{ name: 'Log2PLDSF', addr: Log2PLDSF.address },
{ name: 'AssertionStorage', addr: AssertionStorage.address },
{ name: 'IdentityStorage', addr: IdentityStorage.address },
{ name: 'ShardingTableStorage', addr: ShardingTableStorage.address },
Expand Down Expand Up @@ -223,7 +219,7 @@ describe('@v1 @unit HubController contract', function () {
],
},
{
contractName: 'ProogManagerV1',
contractName: 'ProofManagerV1',
encodedData: [
'0x7ea63c6e00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001',
'0x7ea63c6e00000000000000000000000000000000000000000000000000000000000000030000000000000000000000000000000000000000000000000000000000000001',
Expand Down
2 changes: 1 addition & 1 deletion utils/helpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ export class Helpers {

if (this.isDeployed(nameInHub)) {
const contractInstance = await this.hre.ethers.getContractAt(
nameInHub,
this.getAbi(newContractName),
this.contractDeployments.contracts[nameInHub].evmAddress,
deployer,
);
Expand Down

0 comments on commit 1c8489b

Please sign in to comment.