proposal-39-one-year-reimbu.../test/ReimbursementProposal.t.sol

33 lines
1.2 KiB
Solidity

// SPDX-License-Identifier: MIT
pragma solidity ^0.8.19;
import { ProposalUtils } from "./utils/ProposalUtils.sol";
import { ReimbursementProposal } from "@root/ReimbursementProposal.sol";
import { IERC20 } from "@openzeppelin/contracts/token/ERC20/IERC20.sol";
import { console2 } from "@forge-std/console2.sol";
contract TestReimbursementProposal is ProposalUtils {
address public constant developerAddress = 0x9Ff3C1Bea9ffB56a78824FE29f457F066257DD58;
function createAndExecuteProposal() public {
address proposalAddress = address(new ReimbursementProposal());
proposeAndExecute(proposalAddress);
}
function testFundsTransferred() public {
IERC20 TORN = IERC20(tornTokenAddress);
uint256 amountBeforeProposalExecution = TORN.balanceOf(developerAddress);
console2.log("Balance before execution: %s", amountBeforeProposalExecution / 1e18);
createAndExecuteProposal();
uint256 amountAfterProposalExecution = TORN.balanceOf(developerAddress);
console2.log("Balance after execution: %s", amountAfterProposalExecution / 1e18);
require(amountAfterProposalExecution - amountBeforeProposalExecution == 6226 * 1e18);
}
}