Skip to content

Commit

Permalink
Merge branch 'main' into dev
Browse files Browse the repository at this point in the history
  • Loading branch information
arr00 authored Jan 16, 2024
2 parents cbcd05c + d2856e2 commit a6bbedc
Show file tree
Hide file tree
Showing 9 changed files with 311 additions and 33 deletions.
38 changes: 26 additions & 12 deletions contracts/crowdfund/AtomicManualParty.sol
Original file line number Diff line number Diff line change
Expand Up @@ -44,21 +44,28 @@ contract AtomicManualParty {
uint256[] memory preciousTokenIds,
uint40 rageQuitTimestamp,
address[] memory partyMembers,
uint96[] memory partyMemberVotingPowers
uint96[] memory partyMemberVotingPowers,
address[] memory authorities
) public returns (Party party) {
uint96 totalVotingPower = _validateAtomicManualPartyArrays(
partyMembers,
partyMemberVotingPowers
);

address[] memory authorities = new address[](1);
authorities[0] = address(this);

opts.governance.totalVotingPower = totalVotingPower;

address[] memory authorities_;
{
uint256 authoritiesLength = authorities.length + 1;
authorities_ = new address[](authoritiesLength);
for (uint i = 0; i < authoritiesLength - 1; ++i) {
authorities_[i] = authorities[i];
}
authorities_[authoritiesLength - 1] = address(this);
}

party = PARTY_FACTORY.createParty(
partyImpl,
authorities,
authorities_,
opts,
preciousTokens,
preciousTokenIds,
Expand Down Expand Up @@ -89,21 +96,28 @@ contract AtomicManualParty {
MetadataProvider provider,
bytes memory metadata,
address[] memory partyMembers,
uint96[] memory partyMemberVotingPowers
uint96[] memory partyMemberVotingPowers,
address[] memory authorities
) external returns (Party party) {
uint96 totalVotingPower = _validateAtomicManualPartyArrays(
partyMembers,
partyMemberVotingPowers
);

address[] memory authorities = new address[](1);
authorities[0] = address(this);

opts.governance.totalVotingPower = totalVotingPower;

address[] memory authorities_;
{
uint256 authoritiesLength = authorities.length + 1;
authorities_ = new address[](authoritiesLength);
for (uint i = 0; i < authoritiesLength - 1; ++i) {
authorities_[i] = authorities[i];
}
authorities_[authoritiesLength - 1] = address(this);
}

party = PARTY_FACTORY.createPartyWithMetadata(
partyImpl,
authorities,
authorities_,
opts,
preciousTokens,
preciousTokenIds,
Expand Down
15 changes: 15 additions & 0 deletions deploy/BaseSepolia.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 SepoliaDeploy is DeployScript {
function _run() internal override {
console.log("Starting base sepolia deploy script.");

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

console.log("Ending base sepolia deploy script.");
}
}
3 changes: 3 additions & 0 deletions deploy/Deploy.s.sol
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,9 @@ abstract contract Deploy {
console.log("");
console.log("### ProposalExecutionEngine");
console.log(" Deploying - ProposalExecutionEngine");
if (deployConstants.zoraReserveAuctionCoreEth == address(0)) {
revert("zoraReserveAuctionCoreEth address cannot be 0");
}
IReserveAuctionCoreEth zora = IReserveAuctionCoreEth(
deployConstants.zoraReserveAuctionCoreEth
);
Expand Down
68 changes: 68 additions & 0 deletions deploy/LibDeployConstants.sol
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,74 @@ library LibDeployConstants {
string baseExternalURL;
}

function sepolia(address multisig) internal pure returns (DeployConstants memory) {
address[] memory allowedERC20SwapOperatorTargets = new address[](0);

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,
nounsAuctionHouse: 0x0000000000000000000000000000000000000000,
zoraReserveAuctionCoreEth: 0x0000000000000000000000000000000000000000,
networkName: "sepolia",
deployedNounsMarketWrapper: 0x0000000000000000000000000000000000000000,
contributionRouterInitialFee: 0.00055 ether,
tokenDistributorV1: 0x0000000000000000000000000000000000000000,
tokenDistributorV2: 0x0000000000000000000000000000000000000000,
baseExternalURL: "https://party.app/party/"
});

return deployConstants;
}

function baseSepolia(address multisig) internal pure returns (DeployConstants memory) {
address[] memory allowedERC20SwapOperatorTargets = new address[](0);

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,
nounsAuctionHouse: 0x0000000000000000000000000000000000000000,
zoraReserveAuctionCoreEth: 0x0000000000000000000000000000000000000000,
networkName: "base-sepolia",
deployedNounsMarketWrapper: 0x0000000000000000000000000000000000000000,
contributionRouterInitialFee: 0.00055 ether,
tokenDistributorV1: 0x0000000000000000000000000000000000000000,
tokenDistributorV2: 0x0000000000000000000000000000000000000000,
baseExternalURL: "https://party.app/party/"
});

return deployConstants;
}

function goerli(address multisig) internal pure returns (DeployConstants memory) {
address[] memory allowedERC20SwapOperatorTargets = new address[](1);
allowedERC20SwapOperatorTargets[0] = 0xF91bB752490473B8342a3E964E855b9f9a2A668e; // 0x Swap Aggregator
Expand Down
15 changes: 15 additions & 0 deletions deploy/Sepolia.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 SepoliaDeploy is DeployScript {
function _run() internal override {
console.log("Starting sepolia deploy script.");

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

console.log("Ending sepolia deploy script.");
}
}
10 changes: 6 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,12 @@
"test:fork": "yarn test --fork-url $ETH_RPC_URL",
"test:gas": "forge test --ffi --mc GasBenchmarks -vv",
"deploy": "node js/deploy.js",
"deploy:goerli": "DRY_RUN=0 forge script ./deploy/Goerli.s.sol -vvv --rpc-url $GOERLI_RPC_URL --broadcast --etherscan-api-key $ETHERSCAN_API_KEY --via-ir --skip test --optimize --optimizer-runs 0 --ffi --slow",
"deploy:goerli:dry": "DRY_RUN=1 forge script ./deploy/Goerli.s.sol -vvv --rpc-url $GOERLI_RPC_URL --via-ir --skip test --optimize --optimizer-runs 0 --ffi",
"deploy:mainnet": "DRY_RUN=0 forge script ./deploy/Mainnet.s.sol -vvv --rpc-url $ETH_RPC_URL --broadcast --etherscan-api-key $ETHERSCAN_API_KEY --via-ir --skip test --optimize --optimizer-runs 0 --ffi --slow",
"deploy:mainnet:dry": "DRY_RUN=1 forge script ./deploy/Mainnet.s.sol -vvv --rpc-url $ETH_RPC_URL --via-ir --skip test --optimize --optimizer-runs 0 --ffi",
"deploy:goerli": "DRY_RUN=0 forge script ./deploy/Goerli.s.sol -vvv --rpc-url $GOERLI_RPC_URL --broadcast --etherscan-api-key $ETHERSCAN_API_KEY --via-ir --skip test --optimize --optimizer-runs 95 --ffi --slow",
"deploy:goerli:dry": "DRY_RUN=1 forge script ./deploy/Goerli.s.sol -vvv --rpc-url $GOERLI_RPC_URL --via-ir --skip test --optimize --optimizer-runs 95 --ffi",
"deploy:sepolia": "DRY_RUN=0 forge script ./deploy/Sepolia.s.sol -vvv --rpc-url $SEPOLIA_RPC_URL --broadcast --etherscan-api-key $ETHERSCAN_API_KEY --via-ir --skip test --optimize --optimizer-runs 95 --ffi --slow",
"deploy:sepolia:dry": "DRY_RUN=1 forge script ./deploy/Sepolia.s.sol -vvv --rpc-url $SEPOLIA_RPC_URL --via-ir --skip test --optimize --optimizer-runs 95 --ffi",
"deploy:mainnet": "DRY_RUN=0 forge script ./deploy/Mainnet.s.sol -vvv --rpc-url $ETH_RPC_URL --broadcast --etherscan-api-key $ETHERSCAN_API_KEY --via-ir --skip test --optimize --optimizer-runs 95 --ffi --slow",
"deploy:mainnet:dry": "DRY_RUN=1 forge script ./deploy/Mainnet.s.sol -vvv --rpc-url $ETH_RPC_URL --via-ir --skip test --optimize --optimizer-runs 95 --ffi",
"deploy:base": "DRY_RUN=0 forge script ./deploy/Base.s.sol -vvv --rpc-url $BASE_RPC_URL --via-ir --broadcast --etherscan-api-key $BASESCAN_API_KEY --evm-version paris --skip test --optimize --optimizer-runs 0 --ffi --slow",
"deploy:base:dry": "DRY_RUN=1 forge script ./deploy/Base.s.sol -vvv --rpc-url $BASE_RPC_URL --via-ir --evm-version paris --skip test --optimize --optimizer-runs 0 --ffi",
"deploy:base-goerli": "DRY_RUN=0 forge script ./deploy/BaseGoerli.s.sol -vvv --rpc-url $BASE_GOERLI_RPC_URL --via-ir --broadcast --etherscan-api-key $BASESCAN_API_KEY --evm-version paris --skip test --optimize --optimizer-runs 0 --ffi --slow",
Expand Down
Loading

0 comments on commit a6bbedc

Please sign in to comment.