39 lines
1.4 KiB
Solidity
39 lines
1.4 KiB
Solidity
|
// SPDX-License-Identifier: MIT
|
||
|
pragma solidity ^0.8.19;
|
||
|
|
||
|
import { ProposalUtils } from "./utils/ProposalUtils.sol";
|
||
|
import { PaidListingProposal } from "@root/PaidListingProposal.sol";
|
||
|
import { IERC20 } from "@openzeppelin/contracts/token/ERC20/IERC20.sol";
|
||
|
|
||
|
import { console2 } from "@forge-std/console2.sol";
|
||
|
|
||
|
contract TestPaidListingProposal is ProposalUtils {
|
||
|
modifier executeCurrentProposalBefore() {
|
||
|
createAndExecuteProposal();
|
||
|
_;
|
||
|
}
|
||
|
|
||
|
function createAndExecuteProposal() public {
|
||
|
address proposalAddress = address(new PaidListingProposal()); /* 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 == 2012 ether);
|
||
|
}
|
||
|
}
|