Skip to content

Commit

Permalink
test: local deployment script
Browse files Browse the repository at this point in the history
  • Loading branch information
the-emerald committed Jan 10, 2025
1 parent b2ff45a commit 7303dfd
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 0 deletions.
24 changes: 24 additions & 0 deletions script/TESTWanderStaking.s.sol
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
// SPDX-License-Identifier: UNLICENSED
pragma solidity ^0.8.13;

import {Script, console} from "forge-std/Script.sol";
import {WanderStaking} from "../src/WanderStaking.sol";
import {TestToken} from "../src/TestToken.sol";
import {ERC1967Proxy} from "@openzeppelin/contracts/proxy/ERC1967/ERC1967Proxy.sol";

contract TESTWanderStaking is Script {
function setUp() public {}

function run() public {
vm.startBroadcast();

TestToken token = new TestToken();

WanderStaking stakingImpl = new WanderStaking();

bytes memory data = abi.encodeWithSignature("initialize(address,address)", address(this), address(token));
ERC1967Proxy proxy = new ERC1967Proxy(address(stakingImpl), data);

vm.stopBroadcast();
}
}
9 changes: 9 additions & 0 deletions stake.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
set -x

cast rpc anvil_impersonateAccount $USER
cast send $TOKEN --from $USER "mint(address,uint256)" $USER 1000000000000000000000 --unlocked
cast call $TOKEN "balanceOf(address)(uint256)" $USER
cast send $TOKEN --from $USER "approve(address,uint256)" $STAKE $(cast max-uint) --unlocked
cast send $STAKE --from $USER "stake(uint256)" 1000000000000000000000 --unlocked
cast send $STAKE --from $USER "unstake(uint256)" 100000000000000000000 --unlocked
cast send $STAKE --from $USER "unstake(uint256)" 100000000000000000000 --unlocked

0 comments on commit 7303dfd

Please sign in to comment.