Skip to content

💰 Contrato de loteria, aonde você compra um ticket e participa do sorteio, testes em fuzz com o Foundry.

Notifications You must be signed in to change notification settings

guilhermeboaventurarodrigues/lottery-fuzz-foundry

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

💰 Contrato de loteria, aonde você compra um ticket e participa do sorteio, testes em fuzz com o Foundry.

💼 Regras de negócio:

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.

🧰 Tecnologias utilizadas:

  • Foundry
  • Solidity

✔️ Testes positivos: 14

🎰 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)

‼️ Testes negativos: 10

🎰 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)

About

💰 Contrato de loteria, aonde você compra um ticket e participa do sorteio, testes em fuzz com o Foundry.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published