Skip to content

Commit

Permalink
Change default to 6 and Deploy IPGraphACL if not yet deployed (storyp…
Browse files Browse the repository at this point in the history
  • Loading branch information
kingster-will authored Sep 24, 2024
1 parent 0f9a346 commit 541d33b
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 4 deletions.
2 changes: 1 addition & 1 deletion script/foundry/deployment/Main.s.sol
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import { DeployHelper } from "../utils/DeployHelper.sol";
contract Main is DeployHelper {
address internal ERC6551_REGISTRY = 0x000000006551c19487814612e58FE06813775758;
address internal CREATE3_DEPLOYER = 0x384a891dFDE8180b054f04D66379f16B7a678Ad6;
uint256 internal CREATE3_DEFAULT_SEED = 0;
uint256 internal CREATE3_DEFAULT_SEED = 6;
address internal IP_GRAPH_ACL = 0x680E66e4c7Df9133a7AFC1ed091089B32b89C4ae;
// For arbitration policy
uint256 internal constant ARBITRATION_PRICE = 1000 * 10 ** 6; // 1000 USDC
Expand Down
17 changes: 14 additions & 3 deletions script/foundry/utils/DeployHelper.sol
Original file line number Diff line number Diff line change
Expand Up @@ -142,8 +142,6 @@ contract DeployHelper is Script, BroadcastManager, JsonDeploymentHandler, Storag
MAX_ROYALTY_APPROVAL = maxRoyaltyApproval_;
TREASURY_ADDRESS = treasury_;
ipGraphACL = IPGraphACL(ipGraphACL_);
if (address(ipGraphACL) == address(0))
newDeployedIpGraphACL = true;

/// @dev USDC addresses are fetched from
/// (mainnet) https://developers.circle.com/stablecoins/docs/usdc-on-main-networks
Expand All @@ -162,6 +160,17 @@ contract DeployHelper is Script, BroadcastManager, JsonDeploymentHandler, Storag
writeDeploys = writeDeploys_;
version = version_;

// check if IPGraphACL is deployed
if (address(ipGraphACL) == address(0)) {
newDeployedIpGraphACL = true;
} else if (address(ipGraphACL).code.length == 0) {
newDeployedIpGraphACL = true;
require(
address(ipGraphACL) == _getDeployedAddress(type(IPGraphACL).name),
"Deploy: IPGraphACL Address Mismatch with seed."
);
}

// This will run OZ storage layout check for all contracts. Requires --ffi flag.
if (runStorageLayoutCheck) super.run();

Expand Down Expand Up @@ -662,8 +671,10 @@ contract DeployHelper is Script, BroadcastManager, JsonDeploymentHandler, Storag
abi.encodePacked(type(IPGraphACL).creationCode, abi.encode(address(protocolAccessManager)))
)
);
_postdeploy("IPGraphACL", address(ipGraphACL));
} else {
console2.log("IPGraphACL already deployed");
}
_postdeploy("IPGraphACL", address(ipGraphACL));
}

function _predeploy(string memory contractKey) private view {
Expand Down
16 changes: 16 additions & 0 deletions test/foundry/mocks/token/SUSD.sol
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
// SPDX-License-Identifier: BUSL-1.1
pragma solidity ^0.8.23;

import { ERC20 } from "@openzeppelin/contracts/token/ERC20/ERC20.sol";

contract SUSD is ERC20 {
constructor() ERC20("Story USD", "SUSD") {}

function mint(address to, uint256 amount) external {
_mint(to, amount);
}

function burn(address from, uint256 amount) external {
_burn(from, amount);
}
}

0 comments on commit 541d33b

Please sign in to comment.