Skip to content

Commit

Permalink
add OffChainSignatureValidator to deploy (#368)
Browse files Browse the repository at this point in the history
  • Loading branch information
arr00 authored Dec 22, 2023
1 parent 4be06a0 commit cbcd05c
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 1 deletion.
24 changes: 23 additions & 1 deletion deploy/Deploy.s.sol
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ import { AddPartyCardsAuthority } from "../contracts/authorities/AddPartyCardsAu
import { SellPartyCardsAuthority } from "../contracts/authorities/SellPartyCardsAuthority.sol";
import { SSTORE2MetadataProvider } from "../contracts/renderers/SSTORE2MetadataProvider.sol";
import { BasicMetadataProvider } from "../contracts/renderers/BasicMetadataProvider.sol";
import { OffChainSignatureValidator } from "../contracts/signature-validators/OffChainSignatureValidator.sol";
import "./LibDeployConstants.sol";

abstract contract Deploy {
Expand Down Expand Up @@ -81,6 +82,7 @@ abstract contract Deploy {
ContributionRouter public contributionRouter;
AddPartyCardsAuthority public addPartyCardsAuthority;
SellPartyCardsAuthority public sellPartyCardsAuthority;
OffChainSignatureValidator public offChainSignatureValidator;

function deploy(LibDeployConstants.DeployConstants memory deployConstants) public virtual {
_switchDeployer(DeployerRole.Default);
Expand Down Expand Up @@ -390,6 +392,15 @@ abstract contract Deploy {
_trackDeployerGasAfter();
console.log(" Deployed - ContributionRouter", address(contributionRouter));

// Deploy OFF_CHAIN_SIGNATURE_VALIDATOR
console.log("");
console.log("### OffChainSignatureValidator");
console.log(" Deploying - OffChainSignatureValidator");
_trackDeployerGasBefore();
offChainSignatureValidator = new OffChainSignatureValidator();
_trackDeployerGasAfter();
console.log(" Deployed - OffChainSignatureValidator", address(offChainSignatureValidator));

// DEPLOY_GATE_KEEPRS
console.log("");
console.log("### GateKeepers");
Expand Down Expand Up @@ -564,6 +575,13 @@ abstract contract Deploy {
globals.setAddress,
(LibGlobals.GLOBAL_METADATA_REGISTRY, address(metadataRegistry))
);
multicallData[n++] = abi.encodeCall(
globals.setAddress,
(
LibGlobals.GLOBAL_OFF_CHAIN_SIGNATURE_VALIDATOR,
address(offChainSignatureValidator)
)
);
// transfer ownership of Globals to multisig
if (this.getDeployer() != deployConstants.partyDaoMultisig) {
multicallData[n++] = abi.encodeCall(
Expand Down Expand Up @@ -678,7 +696,7 @@ contract DeployScript is Script, Deploy {
Deploy.deploy(deployConstants);
vm.stopBroadcast();

AddressMapping[] memory addressMapping = new AddressMapping[](29);
AddressMapping[] memory addressMapping = new AddressMapping[](30);
addressMapping[0] = AddressMapping("Globals", address(globals));
addressMapping[1] = AddressMapping("TokenDistributor", address(tokenDistributor));
addressMapping[2] = AddressMapping(
Expand Down Expand Up @@ -737,6 +755,10 @@ contract DeployScript is Script, Deploy {
"SellPartyCardsAuthority",
address(sellPartyCardsAuthority)
);
addressMapping[29] = AddressMapping(
"OffChainSignatureValidator",
address(offChainSignatureValidator)
);

console.log("");
console.log("### Deployed addresses");
Expand Down
1 change: 1 addition & 0 deletions utils/output-abis.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ const RELEVANT_ABIS = [
"ContributionRouter",
"AddPartyCardsAuthority",
"SellPartyCardsAuthority",
"OffChainSignatureValidator",
];

// AFileName -> a_file_name
Expand Down

0 comments on commit cbcd05c

Please sign in to comment.