Skip to content

Commit

Permalink
fix import forge-std
Browse files Browse the repository at this point in the history
  • Loading branch information
najamuslim committed Aug 9, 2024
1 parent e44bfb6 commit 5296b31
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 29 deletions.
6 changes: 0 additions & 6 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,4 @@ docs/

# dev file
.vscode/
.next/
lib/
backend/
frontend/
backend/node_modules/
frontend/node_modules/
node_modules/
10 changes: 5 additions & 5 deletions script/BottleToken.s.sol
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
// SPDX-License-Identifier: UNLICENSED
pragma solidity ^0.8.13;

import {Script, console} from "forge-std/Script.sol";
import {BottleToken} from "../src/BottleToken.sol";
import {Script, console} from "lib/forge-std/src/Script.sol";
import {XottleToken} from "../src/XottleToken.sol";

contract BottleTokenScript is Script {
BottleToken public bottleToken;
contract XottleTokenScript is Script {
XottleToken public xottleToken;

function setUp() public {}

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

bottleToken = new BottleToken();
xottleToken = new XottleToken(msg.sender);

vm.stopBroadcast();
}
Expand Down
File renamed without changes.
40 changes: 22 additions & 18 deletions test/Counter.t.sol
Original file line number Diff line number Diff line change
@@ -1,24 +1,28 @@
// SPDX-License-Identifier: UNLICENSED
pragma solidity ^0.8.13;
pragma solidity ^0.8.23;

import {Test, console} from "forge-std/Test.sol";
// import {Counter} from "../src/Counter.sol";
import {Test} from "lib/forge-std/src/Test.sol";
import {XottleToken} from "../src/XottleToken.sol";

// contract CounterTest is Test {
// Counter public counter;
contract XottleTokenTest is Test {
XottleToken public token;
address public owner;

// function setUp() public {
// counter = new Counter();
// counter.setNumber(0);
// }
function setUp() public {
owner = address(this);
token = new XottleToken(owner);
}

// function test_Increment() public {
// counter.increment();
// assertEq(counter.number(), 1);
// }
function testMint() public {
uint256 amount = 1000;
token.mint(address(this), amount);
assertEq(token.balanceOf(address(this)), amount);
}

// function testFuzz_SetNumber(uint256 x) public {
// counter.setNumber(x);
// assertEq(counter.number(), x);
// }
// }
function testApprove() public {
uint256 amount = 500;
token.mint(address(this), 1000); // Mint tokens first
token.approve(address(0xBEEF), amount);
assertEq(token.allowance(address(this), address(0xBEEF)), amount);
}
}

0 comments on commit 5296b31

Please sign in to comment.