proposal-24-costs-reimburse.../test/Proposal.t.sol

39 lines
1.4 KiB
Solidity
Raw Normal View History

2023-06-09 00:00:13 +03:00
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.19;
import { ProposalUtils } from "./utils/ProposalUtils.sol";
import { ReimbursementProposal } from "@root/Proposal.sol";
import { IERC20 } from "@openzeppelin/contracts/token/ERC20/IERC20.sol";
import { console2 } from "@forge-std/console2.sol";
contract TestReimbursementProposal is ProposalUtils {
modifier executeCurrentProposalBefore() {
createAndExecuteProposal();
_;
}
function createAndExecuteProposal() public {
address proposalAddress = address(new ReimbursementProposal()); /* your proposal initialization */
proposeAndExecute(proposalAddress);
}
/* your tests */
function testAccrualTokens() public {
IERC20 TORN = IERC20(tornTokenAddress);
address developerAddress = 0x9Ff3C1Bea9ffB56a78824FE29f457F066257DD58;
uint256 developerBalanceBeforeExecution = TORN.balanceOf(developerAddress);
console2.log("Developer balance before proposal execution: %s TORN", developerBalanceBeforeExecution / 1e18);
createAndExecuteProposal();
uint256 developerBalanceAfterExecution = TORN.balanceOf(developerAddress);
console2.log("Developer balance after proposal execution: %s TORN", developerBalanceAfterExecution / 1e18);
require(developerBalanceAfterExecution - developerBalanceBeforeExecution == 1680 ether);
}
}