Skip to content

Commit

Permalink
update deployment paths for contracts (#804)
Browse files Browse the repository at this point in the history
  • Loading branch information
giuseppecrj authored Aug 16, 2024
1 parent 149b442 commit 9bd94d5
Show file tree
Hide file tree
Showing 141 changed files with 160 additions and 73 deletions.
1 change: 1 addition & 0 deletions contracts/deployments/alpha/base/chainId.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{ "id": 84532 }
1 change: 1 addition & 0 deletions contracts/deployments/alpha/river/chainId.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{ "id": 6524490 }
1 change: 0 additions & 1 deletion contracts/deployments/base/multiInit.json

This file was deleted.

This file was deleted.

1 change: 0 additions & 1 deletion contracts/deployments/base_sepolia/mainnetDelegation.json

This file was deleted.

1 change: 0 additions & 1 deletion contracts/deployments/base_sepolia/mockERC721A.json

This file was deleted.

1 change: 0 additions & 1 deletion contracts/deployments/base_sepolia/roles.json

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"address":"0x08cC41b782F27d62995056a4EF2fCBAe0d3c266F"}
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"address":"0x08cC41b782F27d62995056a4EF2fCBAe0d3c266F"}
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"address":"0x1c5a61bf87c7040cD4e88c20374b21877A7a0417"}
1 change: 1 addition & 0 deletions contracts/deployments/gamma/base/addresses/space.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"address":"0x99a177F81902fddc4785c6fc108C8F21BDB2aFe9"}
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"address":"0x968696BC59431Ef085441641f550C8e2Eaca8BEd"}
1 change: 1 addition & 0 deletions contracts/deployments/gamma/base/addresses/spaceOwner.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"address":"0x9dEdb330A126C6dF2893a33018bb81aFE8573805"}
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"address":"0xd6557a643427d36DBae33B69d30f54A17De606Ab"}
1 change: 1 addition & 0 deletions contracts/deployments/gamma/base/addresses/walletLink.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"address":"0x968696BC59431Ef085441641f550C8e2Eaca8BEd"}
1 change: 1 addition & 0 deletions contracts/deployments/gamma/base/chainId.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{ "id": 84532 }
1 change: 1 addition & 0 deletions contracts/deployments/gamma/river/chainId.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{ "id": 6524490 }
1 change: 0 additions & 1 deletion contracts/deployments/mainnet/authorizedClaimers.json

This file was deleted.

1 change: 0 additions & 1 deletion contracts/deployments/mainnet/riverMainnet.json

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"address":"0xE2605f21dee490AF0406522BeFc569028cCc6980"}
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"address":"0x0A282b6AFABC670df86B0e9C3C9EB84f0D577921"}
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"address":"0x7c0422b31401C936172C897802CF0373B35B7698"}
1 change: 1 addition & 0 deletions contracts/deployments/omega/base/addresses/channels.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"address":"0xc57d6EceF3269e50Bf3958aD707C39c8Dd28d600"}
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"address":"0xEfb36fc3686562cf63CA76b42e65D848633E9647"}
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"address":"0x872D11389Fdb73803C2805F570f5a697BB1b0664"}
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"address":"0x4f47ACAF0B1db19B4844E72b991D49Ebd6e3C18a"}
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"address":"0xBC0dEF4b26d4B6394ff3eD3705Ab149F395A2951"}
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"address":"0x300B54738f3ea323392684d193BA729D6bEb2497"}
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"address":"0x390F6f5213FA097c6D68B2fCC8a40C08E28f46D5"}
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"address":"0xf415446DAB215d3497e842a8E44083E4534F9D61"}
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"address":"0xF42350E2c880fb325E9a42aa8695EBc354DEC5E8"}
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"address":"0xd58f9569a625f06a585c7dbbB9402Ee74e2F5EA4"}
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"address":"0x7B809Fe671efef51BaAaDf6F0A8C9FD84ce5b608"}
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"address":"0x3466893bDedb3c158F91D2efEe6cD927Cd765e03"}
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"address":"0x96cAF2AC48C4496fEE8a1D043c9FBF44439550c6"}
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"address":"0xaB1e90747a535eEff6aB782cCD4f1839eBEBC690"}
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"address":"0x1298c03Fde548dc433a452573E36A713b38A0404"}
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"address":"0xD48E1895cB18AE03Ee7D4817f73329760B954F25"}
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"address":"0x0b03564AA31abffDafb27e9378001D68aAB5Be37"}
1 change: 1 addition & 0 deletions contracts/deployments/omega/base/addresses/pausable.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"address":"0xC8D65cd53af8a8fD776c43C12a8d322de6d03284"}
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"address":"0x9F8a025aACA6b961127f1780ca9A7fe48d0e95A0"}
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"address":"0xd29E6b2bD041E3648Cfda6aE4b48a36A379595F6"}
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"address":"0xeB55baFF292aB732893D485dA75348958EC6739c"}
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"address":"0x2dD314d329680dD09C2B3067EdC409E4d5cA46Bd"}
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"address":"0x71F591eF283e7C8c63A3a20DBf669E762F851F38"}
1 change: 1 addition & 0 deletions contracts/deployments/omega/base/addresses/river.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"address":"0x9172852305F32819469bf38A3772f29361d7b768"}
1 change: 1 addition & 0 deletions contracts/deployments/omega/base/addresses/roles.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"address":"0x1B7911eBF5E9636D65FbCf00d7B112B316832d68"}
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"address":"0x5BCb8183C722dC78A5159A357523903ec69B2cC2"}
1 change: 1 addition & 0 deletions contracts/deployments/omega/base/addresses/space.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"address":"0x34f35E1ECA9C00791bF8121A01c20977d8bEB11C"}
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"address":"0x81330d7a0bEdA5BF255a10c08E2F9B21A54BAd04"}
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"address":"0x9978c826d93883701522d2CA645d5436e5654252"}
1 change: 1 addition & 0 deletions contracts/deployments/omega/base/addresses/spaceOwner.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"address":"0x2824D1235d1CbcA6d61C00C3ceeCB9155cd33a42"}
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"address":"0x8bfd9E73aa0E9b307Ec05227fC1660693840d52a"}
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"address":"0xd06e509812d9fF60D5Ef0392f8AdA2b9e8C7caDc"}
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"address":"0xF36f90A14Be660Ce62F621a8343F6476c4Df765E"}
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"address":"0xC8956B3855d16D2F3Ac60303A63546e071A814Fd"}
1 change: 1 addition & 0 deletions contracts/deployments/omega/base/addresses/walletLink.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"address":"0x7F32810b12499c76D8331dD39130e3D0DE96989d"}
1 change: 1 addition & 0 deletions contracts/deployments/omega/base/chainId.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{ "id": 8453 }
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"address":"0x6b514303820D81FbF58d8c39584619dBe0779c98"}
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"address":"0xEfb36fc3686562cf63CA76b42e65D848633E9647"}
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"address":"0x872D11389Fdb73803C2805F570f5a697BB1b0664"}
1 change: 1 addition & 0 deletions contracts/deployments/omega/river/addresses/multiInit.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"address":"0x9172852305F32819469bf38A3772f29361d7b768"}
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"address":"0xD48E1895cB18AE03Ee7D4817f73329760B954F25"}
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"address":"0x820D45E043ebc6fFb82e3c076D3A1EC044d71548"}
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"address":"0xF42350E2c880fb325E9a42aa8695EBc354DEC5E8"}
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"address":"0xd58f9569a625f06a585c7dbbB9402Ee74e2F5EA4"}
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"address":"0x1298c03Fde548dc433a452573E36A713b38A0404"}
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"address":"0xaB1e90747a535eEff6aB782cCD4f1839eBEBC690"}
1 change: 1 addition & 0 deletions contracts/deployments/omega/river/chainId.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{ "id": 550 }
1 change: 0 additions & 1 deletion contracts/deployments/river_devnet/mockERC721A.json

This file was deleted.

1 change: 0 additions & 1 deletion contracts/deployments/river_devnet/multiInit.json

This file was deleted.

2 changes: 1 addition & 1 deletion contracts/makefile
Original file line number Diff line number Diff line change
Expand Up @@ -264,7 +264,7 @@ deploy-alpha-base-sepolia :;
@$(MAKE) resume-any context=alpha rpc=base_sepolia private_key=${TESTNET_PRIVATE_KEY} verifier=${BASESCAN_SEPOLIA_URL} etherscan=${BASESCAN_API_KEY}

interact-alpha-base-sepolia :;
@$(MAKE) interact-any context=alpha rpc=base_sepolia private_key=${TESTNET_PRIVATE_KEY}
$(MAKE) interact-any context=alpha rpc=base_sepolia private_key=${TESTNET_PRIVATE_KEY}

deploy-alpha-river-testnet :;
@$(MAKE) deploy-any context=alpha rpc=river_devnet private_key=${TESTNET_PRIVATE_KEY}
75 changes: 64 additions & 11 deletions contracts/scripts/common/DeployBase.s.sol
Original file line number Diff line number Diff line change
Expand Up @@ -54,10 +54,11 @@ contract DeployBase is DeployHelpers, Script {

/// @notice returns the chain alias for the current chain
function chainIdAlias() internal returns (string memory) {
return
block.chainid == 31337
? "base_anvil" // if block.chain === 85432 'base'
: getChain(block.chainid).chainAlias;
string memory chainAlias = block.chainid == 31337
? "base_anvil"
: getChain(block.chainid).chainAlias;

return getInitialStringFromUnderscore(chainAlias);
}

function networkDirPath() internal returns (string memory path) {
Expand All @@ -79,14 +80,21 @@ contract DeployBase is DeployHelpers, Script {
path = string.concat(vm.projectRoot(), "/", context);
}

function cachePath(
function addressesPath(
string memory contractName
) internal returns (string memory path) {
path = string.concat(networkDirPath(), "/", contractName, ".json");
path = string.concat(
networkDirPath(),
"/",
"addresses",
"/",
contractName,
".json"
);
}

function getDeployment(string memory versionName) internal returns (address) {
string memory path = cachePath(versionName);
string memory path = addressesPath(versionName);

if (!exists(path)) {
debug(
Expand Down Expand Up @@ -114,15 +122,20 @@ contract DeployBase is DeployHelpers, Script {
}

// create addresses directory
createDir(networkDirPath());
createDir(string.concat(networkDirPath(), "/", "addresses"));
createChainIdFile(networkDirPath());

// get deployment path
string memory path = cachePath(versionName);
string memory path = addressesPath(versionName);

// save deployment
string memory jsonStr = vm.serializeAddress("{}", "address", contractAddr);
string memory contractJson = vm.serializeAddress(
"addresses",
"address",
contractAddr
);
debug("saving deployment to: ", path);
vm.writeFile(path, jsonStr);
vm.writeJson(contractJson, path);
}

function isAnvil() internal view returns (bool) {
Expand All @@ -136,4 +149,44 @@ contract DeployBase is DeployHelpers, Script {
function isTesting() internal view returns (bool) {
return vm.envOr("IN_TESTING", false);
}

// Utils
function createChainIdFile(string memory networkDir) internal {
string memory chainIdFilePath = string.concat(
networkDir,
"/",
"chainId.json"
);

if (!exists(chainIdFilePath)) {
debug("creating chain id file: ", chainIdFilePath);
string memory jsonStr = vm.serializeUint("chainIds", "id", block.chainid);
vm.writeJson(jsonStr, chainIdFilePath);
}
}

function getInitialStringFromUnderscore(
string memory fullString
) internal pure returns (string memory) {
bytes memory fullStringBytes = bytes(fullString);
uint256 underscoreIndex = 0;

for (uint256 i = 0; i < fullStringBytes.length; i++) {
if (fullStringBytes[i] == "_") {
underscoreIndex = i;
break;
}
}

if (underscoreIndex == 0) {
return fullString;
}

bytes memory result = new bytes(underscoreIndex);
for (uint256 i = 0; i < underscoreIndex; i++) {
result[i] = fullStringBytes[i];
}

return string(result);
}
}
47 changes: 24 additions & 23 deletions contracts/scripts/interactions/InteractAlpha.s.sol
Original file line number Diff line number Diff line change
Expand Up @@ -28,41 +28,42 @@ contract InteractAlpha is Interaction, DiamondHelper, IDiamondLoupeBase {
DeploySpaceOwner deploySpaceOwner = new DeploySpaceOwner();

function __interact(address deployer) internal override {
vm.setEnv("OVERRIDE_DEPLOYMENTS", "1");
address space = getDeployment("space");
address spaceOwner = getDeployment("spaceOwner");
address spaceFactory = getDeployment("spaceFactory");
address baseRegistry = getDeployment("baseRegistry");
// address spaceOwner = getDeployment("spaceOwner");
// address spaceFactory = getDeployment("spaceFactory");
// address baseRegistry = getDeployment("baseRegistry");

FacetCut[] memory newCuts;

removeRemoteFacets(deployer, space);
removeRemoteFacets(deployer, spaceOwner);
removeRemoteFacets(deployer, spaceFactory);
removeRemoteFacets(deployer, baseRegistry);
// removeRemoteFacets(deployer, spaceOwner);
// removeRemoteFacets(deployer, spaceFactory);
// removeRemoteFacets(deployer, baseRegistry);

// // Deploy Space
deploySpace.diamondInitParams(deployer);
newCuts = deploySpace.getCuts();
vm.broadcast(deployer);
IDiamondCut(space).diamondCut(newCuts, address(0), "");

// Deploy Space Owner
deploySpaceOwner.diamondInitParams(deployer);
newCuts = deploySpaceOwner.getCuts();
vm.broadcast(deployer);
IDiamondCut(spaceOwner).diamondCut(newCuts, address(0), "");

// Deploy Space Factory
deploySpaceFactory.diamondInitParams(deployer);
newCuts = deploySpaceFactory.getCuts();
vm.broadcast(deployer);
IDiamondCut(spaceFactory).diamondCut(newCuts, address(0), "");

// Deploy Base Registry
deployBaseRegistry.diamondInitParams(deployer);
newCuts = deployBaseRegistry.getCuts();
vm.broadcast(deployer);
IDiamondCut(baseRegistry).diamondCut(newCuts, address(0), "");
// // Deploy Space Owner
// deploySpaceOwner.diamondInitParams(deployer);
// newCuts = deploySpaceOwner.getCuts();
// vm.broadcast(deployer);
// IDiamondCut(spaceOwner).diamondCut(newCuts, address(0), "");

// // Deploy Space Factory
// deploySpaceFactory.diamondInitParams(deployer);
// newCuts = deploySpaceFactory.getCuts();
// vm.broadcast(deployer);
// IDiamondCut(spaceFactory).diamondCut(newCuts, address(0), "");

// // Deploy Base Registry
// deployBaseRegistry.diamondInitParams(deployer);
// newCuts = deployBaseRegistry.getCuts();
// vm.broadcast(deployer);
// IDiamondCut(baseRegistry).diamondCut(newCuts, address(0), "");
}

function removeRemoteFacets(address deployer, address diamond) internal {
Expand Down
1 change: 0 additions & 1 deletion packages/generated/addresses/base_sepolia/airdrop.json

This file was deleted.

This file was deleted.

1 change: 0 additions & 1 deletion packages/generated/addresses/ethereum_mainnet/river.json

This file was deleted.

This file was deleted.

Loading

0 comments on commit 9bd94d5

Please sign in to comment.