💰 Contrato de loteria, aonde você compra um ticket e participa do sorteio, testes em fuzz com o Foundry.
O valor do ticket é 500 tokens, o sorteio acontece de forma manual, quando o sorteio é feito, o ganhador fica com o valor de todos os tickets comprados.
- Foundry
- Solidity
🎰 Lottery
- testBuyTicket()
- testGiftWinner()
- testGetValueGift()
💵 Token
- testTokenName()
- testTokenSymbols()
- testTokenDecimals()
- testTotalSupply()
✏️ Fuzz Tests
- testFuzzBalanceOf(addres wallet)
- testFuzzTransfer(address recipient, uint256 amount)
- testFuzzTransferFrom(address from, address to, uint256 amount)
- testFuzzApprove(address spender, uint256 amount)
- testFuzzAllowance(address ownerToken, address spender)
- testFuzzIncreaseAllowance(address spender, uint256 amount)
- testFuzzDecreaseAllowance(address spender, uint256 amount)
🎰 Lottery
- testFailBuyTicketStatusCLOSED()
- testFailGiftWinnerStatusCLOSED()
- testFailGiftWinnerNotOwner()
- testFailGetValueGiftStatusCLOSED()
💵 Token
✏️ Fuzz Tests
- testFailFuzzTransferNotBalance(address recipient, uint256 amount)
- testFailFuzzApproveNotBalance(address spender, uint256 amount)
- testFailFuzzTransferFromNotBalanace(address from, address to, uint256 amount)
- testFailFuzzTransferFromNotApprove(address from, address to, uint256 amount)
- testFailFuzzDecreaseAllowanceZeroBalance(address spender, uint256 amount)
- testFailBuyTicketOtherValue(uint256 amount)