Skip to content

Commit

Permalink
chore: add deploy command (refactored) (#280)
Browse files Browse the repository at this point in the history
* chore: add interactive deploy command

* fix: remove `--verify`

* show default options

* tweaks

* update script and fix verification (#271)

* do not lint `lib/` folders except `lib/party-addresses/

* support deployments to base

* update addresses

* fix prettier lint

* fix: update deploy scripts to use via-ir

* fix various issues

* remove unnecessary todo

---------

Co-authored-by: Brian Le <[email protected]>
  • Loading branch information
arr00 and 0xble authored Aug 31, 2023
1 parent 0fac810 commit 33fc45e
Show file tree
Hide file tree
Showing 39 changed files with 865 additions and 21,949 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
/node_modules
/tests/built
/js
/deploy/cache/
broadcast/
package-lock.json
yarn.lock
Expand Down
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,6 @@
[submodule "lib/solmate"]
path = lib/solmate
url = https://github.com/transmissions11/solmate
[submodule "lib/party-addresses"]
path = lib/party-addresses
url = https://github.com/PartyDAO/party-addresses
3 changes: 2 additions & 1 deletion .prettierignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@ broadcast
cache
out
js
lib
lib/*
!lib/party-addresses/
node_modules
artifacts
audits
15 changes: 15 additions & 0 deletions deploy/Base.s.sol
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
// SPDX-License-Identifier: Apache-2.0
pragma solidity ^0.8;

import "./Deploy.s.sol";
import "./LibDeployConstants.sol";

contract BaseDeploy is DeployScript {
function _run() internal override {
console.log("Starting base deploy script.");

deploy(LibDeployConstants.base());

console.log("Ending base deploy script.");
}
}
15 changes: 15 additions & 0 deletions deploy/BaseGoerli.s.sol
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
// SPDX-License-Identifier: Apache-2.0
pragma solidity ^0.8;

import "./Deploy.s.sol";
import "./LibDeployConstants.sol";

contract BaseGoerliDeploy is DeployScript {
function _run() internal override {
console.log("Starting base goerli deploy script.");

deploy(LibDeployConstants.baseGoerli(this.getDeployer()));

console.log("Ending base goerli deploy script.");
}
}
4 changes: 2 additions & 2 deletions deploy/Deploy.s.sol
Original file line number Diff line number Diff line change
Expand Up @@ -649,7 +649,7 @@ contract DeployScript is Script, Deploy {
Deploy.deploy(deployConstants);
vm.stopBroadcast();

AddressMapping[] memory addressMapping = new AddressMapping[](23);
AddressMapping[] memory addressMapping = new AddressMapping[](24);
addressMapping[0] = AddressMapping("Globals", address(globals));
addressMapping[1] = AddressMapping("TokenDistributor", address(tokenDistributor));
addressMapping[2] = AddressMapping(
Expand Down Expand Up @@ -678,7 +678,7 @@ contract DeployScript is Script, Deploy {
"CollectionBatchBuyOperator",
address(collectionBatchBuyOperator)
);
addressMapping[12] = AddressMapping("ERC20SwapOperator", address(swapOperator));
addressMapping[23] = AddressMapping("ERC20SwapOperator", address(swapOperator));
addressMapping[13] = AddressMapping("CrowdfundFactory", address(crowdfundFactory));
addressMapping[14] = AddressMapping("MetadataRegistry", address(metadataRegistry));
addressMapping[15] = AddressMapping("MetadataProvider", address(metadataProvider));
Expand Down
66 changes: 66 additions & 0 deletions deploy/LibDeployConstants.sol
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,39 @@ library LibDeployConstants {
return deployConstants;
}

function baseGoerli(address multisig) internal pure returns (DeployConstants memory) {
address[] memory allowedERC20SwapOperatorTargets = new address[](1);
allowedERC20SwapOperatorTargets[0] = 0xF91bB752490473B8342a3E964E855b9f9a2A668e; // 0x Swap Aggregator

DeployConstants memory deployConstants = DeployConstants({
seaportExchangeAddress: 0x00000000000000ADc04C56Bf30aC9d3c0aAF14dC,
osZoraAuctionDuration: 2 minutes,
osZoraAuctionTimeout: 2 minutes,
osMinOrderDuration: 2 minutes,
osMaxOrderDuration: 14 days,
zoraMinAuctionDuration: 2 minutes,
zoraMaxAuctionDuration: 10 days,
zoraMaxAuctionTimeout: 7 days,
minCancelDelay: 5 minutes,
maxCancelDelay: 1 days,
distributorEmergencyActionAllowedDuration: 365 days,
partyDaoMultisig: multisig,
allowedERC20SwapOperatorTargets: allowedERC20SwapOperatorTargets,
osZone: 0x0000000000000000000000000000000000000000,
osConduitKey: 0xf984c55ca75735630c1c27d3d06969c1aa6af1df86d22ddc0e3a978ad6138e9f,
osConduitController: 0x00000000F9490004C11Cef243f5400493c00Ad63,
fractionalVaultFactory: 0x0000000000000000000000000000000000000000,
foundationMarket: 0x0000000000000000000000000000000000000000,
nounsAuctionHouse: 0x0000000000000000000000000000000000000000,
zoraReserveAuctionCoreEth: 0x0000000000000000000000000000000000000000,
networkName: "base-goerli",
deployedNounsMarketWrapper: 0x0000000000000000000000000000000000000000,
deployedFoundationMarketWrapper: 0x0000000000000000000000000000000000000000
});

return deployConstants;
}

function mainnet() internal pure returns (DeployConstants memory) {
address[] memory allowedERC20SwapOperatorTargets = new address[](1);
allowedERC20SwapOperatorTargets[0] = 0xDef1C0ded9bec7F1a1670819833240f027b25EfF; // 0x Swap Aggregator
Expand Down Expand Up @@ -95,4 +128,37 @@ library LibDeployConstants {

return deployConstants;
}

function base() internal pure returns (DeployConstants memory) {
address[] memory allowedERC20SwapOperatorTargets = new address[](1);
allowedERC20SwapOperatorTargets[0] = 0xDef1C0ded9bec7F1a1670819833240f027b25EfF; // 0x Swap Aggregator

DeployConstants memory deployConstants = DeployConstants({
seaportExchangeAddress: 0x00000000000000ADc04C56Bf30aC9d3c0aAF14dC,
osZoraAuctionDuration: 1 days,
osZoraAuctionTimeout: 1 days,
osMinOrderDuration: 1 hours,
osMaxOrderDuration: 4 weeks,
zoraMinAuctionDuration: 1 days,
zoraMaxAuctionDuration: 4 weeks,
zoraMaxAuctionTimeout: 2 weeks,
minCancelDelay: 6 weeks,
maxCancelDelay: 12 weeks,
distributorEmergencyActionAllowedDuration: 365 days,
partyDaoMultisig: 0xF498fd75Ee8D35294952343f1A77CAE5EA5aF6AA,
allowedERC20SwapOperatorTargets: allowedERC20SwapOperatorTargets,
osZone: 0x0000000000000000000000000000000000000000,
osConduitKey: 0xf984c55ca75735630c1c27d3d06969c1aa6af1df86d22ddc0e3a978ad6138e9f,
osConduitController: 0x00000000F9490004C11Cef243f5400493c00Ad63,
fractionalVaultFactory: 0x0000000000000000000000000000000000000000,
foundationMarket: 0x0000000000000000000000000000000000000000,
nounsAuctionHouse: 0x0000000000000000000000000000000000000000,
zoraReserveAuctionCoreEth: 0x0000000000000000000000000000000000000000,
networkName: "base",
deployedNounsMarketWrapper: 0x0000000000000000000000000000000000000000,
deployedFoundationMarketWrapper: 0x0000000000000000000000000000000000000000
});

return deployConstants;
}
}
7 changes: 0 additions & 7 deletions deploy/Mainnet.s.sol
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,6 @@ import "./Deploy.s.sol";
import "./LibDeployConstants.sol";

contract MainnetDeploy is DeployScript {
constructor() {
_deployerByRole[DeployerRole.Default] = 0xdf6602CB4175618228259614fe3792b51919eDdf;
_deployerByRole[DeployerRole.PartyFactory] = 0x5084EAC7494814249E57882722d51bD0eFcA1459;
_deployerByRole[DeployerRole.CrowdfundFactory] = 0x6b244BAe54866c05c85F072D10567d1A964a21aF;
_deployerByRole[DeployerRole.TokenDistributor] = 0xB232F14e8061E2456E325B75C3f7946F3bc382CF;
}

function _run() internal override {
console.log("Starting mainnet deploy script.");

Expand Down
69 changes: 0 additions & 69 deletions deploy/deployed-contracts/abis/allow_list_gate_keeper.json

This file was deleted.

Loading

0 comments on commit 33fc45e

Please sign in to comment.