Skip to content

Commit

Permalink
chore: update system uml, add script functions
Browse files Browse the repository at this point in the history
  • Loading branch information
jparklev committed Apr 19, 2024
1 parent 3d86a24 commit dfd94cf
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 5 deletions.
Binary file modified assets/point-tokenization-system.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
37 changes: 32 additions & 5 deletions contracts/script/PointTokenVault.s.sol
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import {ERC1967Proxy} from "@openzeppelin/contracts/proxy/ERC1967/ERC1967Proxy.s
import {MockERC20} from "solmate/test/utils/mocks/MockERC20.sol";

contract DeployPointTokenSystem is Script {
// Sepolia Test Accounts
address payable public JIM = payable(0xD6633c1382896079D3576eC43519d844a8C80B56);
address payable public SAM = payable(0xeeD5B3026060218Dc270AE672be6468053e65E39);
address payable public AVA = payable(0xb30C79546800EF35Ea1fAae56A5faA5C03332D9F);
Expand All @@ -18,10 +19,11 @@ contract DeployPointTokenSystem is Script {
uint256 AVA_PRIVATE_KEY = 0x7617580e9556785c7f9bb93e652df98b6acd0de459300711afbcf53e40ce0358;

address public SEOPLIA_MERKLE_BOT_SAFE = 0xec48011b60be299A2684F36Bdb3B498a61A6CbF3;
address public SEPOLIA_OPERATOR_SAFE = 0xec48011b60be299A2684F36Bdb3B498a61A6CbF3;
address public SEOPLIA_ADMIN_SAFE = 0xec48011b60be299A2684F36Bdb3B498a61A6CbF3; // todo: change to actual admin safe

function run() public {
uint256 deployerPrivateKey = vm.envUint("PRIVATE_KEY_MERKLE_BOT_A");
uint256 deployerPrivateKey = vm.envUint("DEPLOYER_PRIVATE_KEY");
vm.startBroadcast(deployerPrivateKey);

// token.approve(address(pointTokenVault), 5e18);
Expand All @@ -40,14 +42,39 @@ contract DeployPointTokenSystem is Script {

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.revokeRole(pointTokenVault.DEFAULT_ADMIN_ROLE(), address(this));

// pointTokenVault.upgradeToAndCall(address(PTVSingleton), bytes(""));
vm.stopBroadcast();
}

function deposit() {
vm.startBroadcast(JIM_PRIVATE_KEY);

token.approve(address(pointTokenVault), 5e18);
pointTokenVault.deposit(token, 5e18, JIM);

token.balanceOf(JIM);

vm.stopBroadcast();
}

function upgrade() {
vm.startBroadcast();

PointTokenVault PointTokenVaultImplementation = new PointTokenVault();

pointTokenVault.upgradeToAndCall(address(PointTokenVaultImplementation), bytes(""));

vm.stopBroadcast();
}

function deployMockERC20() {
vm.startBroadcast(JIM_PRIVATE_KEY);

// pointTokenHub.setTrusted(address(pointTokenVault), true);
MockERC20 token = new MockERC20("Test Token", "TST", 18);

// pointTokenHub.transferOwnership(SEOPLIA_SAFE_ADDRESS);
// pointTokenVault.transferOwnership(SEOPLIA_SAFE_ADDRESS);
token.mint(JIM, 100e18);

vm.stopBroadcast();
}
Expand Down

0 comments on commit dfd94cf

Please sign in to comment.