Skip to content

Commit

Permalink
fix: add deployments
Browse files Browse the repository at this point in the history
  • Loading branch information
rhlsthrm committed Apr 8, 2024
1 parent 3d9628f commit 5a6c180
Show file tree
Hide file tree
Showing 7 changed files with 325 additions and 6 deletions.
157 changes: 157 additions & 0 deletions broadcast/Deploy.s.sol/34443/run-1712571524.json

Large diffs are not rendered by default.

157 changes: 157 additions & 0 deletions broadcast/Deploy.s.sol/34443/run-latest.json

Large diffs are not rendered by default.

2 changes: 2 additions & 0 deletions deploy-mode.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
source .env
forge script ./script/Deploy.s.sol --ffi --json --rpc-url mode --private-key $MODE_PRIVATE_KEY --broadcast --verify --verifier blockscout --verifier-url https://explorer.mode.network/api? -vvv
2 changes: 2 additions & 0 deletions foundry.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,5 @@ build_info = true
extra_output = ["storageLayout"]

# See more config options https://github.com/foundry-rs/foundry/blob/master/crates/config/README.md#all-options
[rpc_endpoints]
mode = "https://mainnet.mode.network"
7 changes: 4 additions & 3 deletions script/Deploy.s.sol
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,13 @@ pragma solidity ^0.8.13;
import {Script, console} from "forge-std/Script.sol";
import {DeployHelper} from "./DeployHelper.sol";

contract DeployScript is Script, DeployHelper {
contract DeployMode is Script, DeployHelper {
function setUp() public {}

function run() public {
vm.broadcast();
_deployImplementationAndProxy();
address multisig = 0x6EAC39BBe26f0d6Ab8DF0f974734D2228d4Da226;
vm.startBroadcast();
_deployImplementationAndProxy(multisig);
vm.stopBroadcast();
}
}
4 changes: 2 additions & 2 deletions script/DeployHelper.sol
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@ import {ERC1967Utils} from "openzeppelin-contracts/contracts/proxy/ERC1967/ERC19

contract DeployHelper {
IonicToken public token;
function _deployImplementationAndProxy() internal {
function _deployImplementationAndProxy(address owner) internal {
// Deploy the proxy and initialize the contract through the proxy
address proxy = Upgrades.deployUUPSProxy(
"IonicToken.sol",
abi.encodeCall(IonicToken.initialize, (msg.sender))
abi.encodeCall(IonicToken.initialize, (owner))
);
token = IonicToken(proxy);
}
Expand Down
2 changes: 1 addition & 1 deletion test/IonicToken.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ contract IonicTokenTest is Test, DeployHelper {
function setUp() public {
(owner, ownerPk) = makeAddrAndKey("alice");
vm.startPrank(owner);
_deployImplementationAndProxy();
_deployImplementationAndProxy(msg.sender);
vm.stopPrank();

sigUtils = new SigUtils(token.DOMAIN_SEPARATOR());
Expand Down

0 comments on commit 5a6c180

Please sign in to comment.