Skip to content

Commit

Permalink
chore: fmt
Browse files Browse the repository at this point in the history
  • Loading branch information
the-emerald committed Jan 3, 2025
1 parent 22f0acd commit 4019159
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 12 deletions.
6 changes: 2 additions & 4 deletions src/TestToken.sol
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,9 @@ pragma solidity ^0.8.22;
import {ERC20} from "@openzeppelin/contracts/token/ERC20/ERC20.sol";

contract TestToken is ERC20 {
constructor()
ERC20("Test Token", "TEST")
{}
constructor() ERC20("Test Token", "TEST") {}

function mint(address to, uint256 amount) public {
_mint(to, amount);
}
}
}
7 changes: 3 additions & 4 deletions src/WanderStaking.sol
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import {Pausable} from "@openzeppelin/contracts/utils/Pausable.sol";

contract WanderStaking is Ownable, Pausable {
using SafeERC20 for IERC20;

IERC20 public immutable token;

event Stake(address indexed user, uint256 amount);
Expand All @@ -19,17 +20,15 @@ contract WanderStaking is Ownable, Pausable {
mapping(address => uint256) userStake;
uint256 internal totalStaked;

constructor(address initialOwner, IERC20 _token)
Ownable(initialOwner)
{
constructor(address initialOwner, IERC20 _token) Ownable(initialOwner) {
token = _token;
}

function pause() public onlyOwner {
_pause();
}

function unpause() public onlyOwner() {
function unpause() public onlyOwner {
_unpause();
}

Expand Down
8 changes: 4 additions & 4 deletions test/WanderStaking.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ contract WanderStakingTest is Test {

function setUp() public {
token = new TestToken();

staking = new WanderStaking(address(this), IERC20(token));
token.approve(address(staking), ~uint256(0));
}
Expand Down Expand Up @@ -63,9 +63,9 @@ contract WanderStakingTest is Test {

// Pad staking contract with some tokens first
vm.startPrank(msg.sender);
token.mint(msg.sender, amount * 2);
token.approve(address(staking), ~uint256(0));
staking.stake(amount * 2);
token.mint(msg.sender, amount * 2);
token.approve(address(staking), ~uint256(0));
staking.stake(amount * 2);
vm.stopPrank();

token.mint(address(this), amount);
Expand Down

0 comments on commit 4019159

Please sign in to comment.