Skip to content

Commit

Permalink
mainnet deployment v1 (#45)
Browse files Browse the repository at this point in the history
* chore: rmv unused version in script, set mainnet addresses

* chore: push deployment artifacts
  • Loading branch information
jparklev authored Oct 16, 2024
1 parent 5f59e28 commit 94b513b
Show file tree
Hide file tree
Showing 4 changed files with 746 additions and 13 deletions.
367 changes: 367 additions & 0 deletions broadcast/PointTokenVault.s.sol/1/run-1725680227.json

Large diffs are not rendered by default.

367 changes: 367 additions & 0 deletions broadcast/PointTokenVault.s.sol/1/run-latest.json

Large diffs are not rendered by default.

21 changes: 10 additions & 11 deletions contracts/script/PointTokenVault.s.sol
Original file line number Diff line number Diff line change
Expand Up @@ -31,33 +31,32 @@ contract PointTokenVaultScripts is BatchScript {
address public MAINNET_MERKLE_UPDATER = 0xfDE9f367c933A7D7E7348D4a3e6e096d814F5828;
address public MAINNET_OPERATOR = 0x0c0264Ba7799dA7aF0fd141ba5Ba976E6DcC6C17;
address public MAINNET_ADMIN = 0x9D89745fD63Af482ce93a9AdB8B0BbDbb98D3e06;
address public FEE_COLLECTOR = MAINNET_OPERATOR; // TODO: deploy another safe for fee collection?

string public VERSION = "0.0.1";
address public FEE_COLLECTOR = MAINNET_ADMIN;

function run() public returns (address) {
uint256 deployerPrivateKey = vm.envUint("DEPLOYER_PRIVATE_KEY");
uint256 deployerPrivateKey = vm.envUint("PRIVATE_KEY");

vm.startBroadcast(deployerPrivateKey);

PointTokenVault pointTokenVault = run(VERSION);
// Deploy implementation and proxy, return proxy
PointTokenVault pointTokenVault = runDeploy();

// Set roles
pointTokenVault.grantRole(pointTokenVault.MERKLE_UPDATER_ROLE(), SEOPLIA_MERKLE_BOT_SAFE);
pointTokenVault.grantRole(pointTokenVault.DEFAULT_ADMIN_ROLE(), SEOPLIA_ADMIN_SAFE);
pointTokenVault.grantRole(pointTokenVault.OPERATOR_ROLE(), SEPOLIA_OPERATOR_SAFE);
pointTokenVault.grantRole(pointTokenVault.MERKLE_UPDATER_ROLE(), MAINNET_MERKLE_UPDATER);
pointTokenVault.grantRole(pointTokenVault.DEFAULT_ADMIN_ROLE(), MAINNET_ADMIN);
pointTokenVault.grantRole(pointTokenVault.OPERATOR_ROLE(), MAINNET_OPERATOR);

// Remove self
// Remove deployer
pointTokenVault.revokeRole(pointTokenVault.DEFAULT_ADMIN_ROLE(), msg.sender);

require(!pointTokenVault.hasRole(pointTokenVault.DEFAULT_ADMIN_ROLE(), msg.sender), "Self role not removed");
require(!pointTokenVault.hasRole(pointTokenVault.DEFAULT_ADMIN_ROLE(), msg.sender), "Deployer role not removed");

vm.stopBroadcast();

return address(pointTokenVault);
}

function run(string memory version) public returns (PointTokenVault) {
function runDeploy() public returns (PointTokenVault) {
PointTokenVault pointTokenVault = PointTokenVault(
payable(
Upgrades.deployUUPSProxy(
Expand Down
4 changes: 2 additions & 2 deletions contracts/test/PointTokenVault.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ contract PointTokenVaultTest is Test {
PointTokenVaultScripts scripts = new PointTokenVaultScripts();

// Deploy the PointTokenVault
pointTokenVault = scripts.run("0.0.1");
pointTokenVault = scripts.runDeploy();

pointTokenVault.grantRole(pointTokenVault.DEFAULT_ADMIN_ROLE(), admin);
pointTokenVault.grantRole(pointTokenVault.MERKLE_UPDATER_ROLE(), merkleUpdater);
Expand Down Expand Up @@ -981,7 +981,7 @@ contract PointTokenVaultTest is Test {
function _deployAdditionalVault() internal returns (PointTokenVault mockVault) {
PointTokenVaultScripts scripts = new PointTokenVaultScripts();

mockVault = scripts.run("0.0.1");
mockVault = scripts.runDeploy();

mockVault.grantRole(pointTokenVault.DEFAULT_ADMIN_ROLE(), admin);
mockVault.grantRole(pointTokenVault.MERKLE_UPDATER_ROLE(), merkleUpdater);
Expand Down

0 comments on commit 94b513b

Please sign in to comment.