-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
b2ff45a
commit 7303dfd
Showing
2 changed files
with
33 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |