-
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
e68ea9e
commit 51d7580
Showing
3 changed files
with
48 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
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,30 @@ | ||
// SPDX-License-Identifier: UNLICENSED | ||
pragma solidity ^0.8.25; | ||
|
||
import "forge-std/Test.sol"; | ||
import "../src/FoxStaking.sol"; | ||
import "@openzeppelin/contracts/utils/Strings.sol"; | ||
import {Ownable} from "@openzeppelin/contracts/access/Ownable.sol"; | ||
import {Pausable} from "@openzeppelin/contracts/utils/Pausable.sol"; | ||
import {Upgrades} from "openzeppelin-foundry-upgrades/Upgrades.sol"; | ||
import {MockFOXToken} from "./MockFOXToken.sol"; | ||
|
||
contract FOXStakingTestUpgrades is Test { | ||
FoxStaking public foxStaking; | ||
MockFOXToken public foxToken; | ||
address user = address(0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045); | ||
|
||
function setUp() public { | ||
foxToken = new MockFOXToken(); | ||
address foxStakingProxy = Upgrades.deployUUPSProxy( | ||
"FoxStaking.sol", | ||
abi.encodeCall(FoxStaking.initialize, (address(foxToken))) | ||
); | ||
foxStaking = FoxStaking(foxStakingProxy); | ||
} | ||
|
||
function testCanDeploy() public view { | ||
uint256 expectedVersion = 1; | ||
assertEq(foxStaking.version(), expectedVersion); | ||
} | ||
} |
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,16 @@ | ||
// SPDX-License-Identifier: UNLICENSED | ||
pragma solidity ^0.8.25; | ||
|
||
import "forge-std/Test.sol"; | ||
import "@openzeppelin/contracts/token/ERC20/ERC20.sol"; | ||
|
||
contract MockFOXToken is ERC20 { | ||
constructor() ERC20("Mock FOX Token", "FOX") { | ||
// 1M FOX for testing, only in local chain can't use this as voting power soz | ||
_mint(address(this), 1e24); | ||
} | ||
|
||
function makeItRain(address to, uint256 amount) public { | ||
_transfer(address(this), to, amount); | ||
} | ||
} |