How to Write Basic Tests | Testing with Foundry

  Рет қаралды 10,845

Smart Contract Programmer

Smart Contract Programmer

Күн бұрын

Пікірлер: 29
@smartcontractprogrammer
@smartcontractprogrammer Жыл бұрын
0:00 - Intro 1:00 - Test setup 1:52 - Passing test 3:52 - Test for error 5:37 - Expect revert 6:36 - Test dec 7:17 - Test verbosity 8:31 - Gas report Code github.com/t4sk/hello-foundry Book book.getfoundry.sh/ Solidity by Example solidity-by-example.org/ Take a course www.smartcontract.engineer/
@redbeet4772
@redbeet4772 Жыл бұрын
There is an error "undeclare identifier" when writing "vm.expectRevert(stdError.arithmeticError)". It seems like the foundry doesn't recognize this, do you know why?
@MatoPrimaB
@MatoPrimaB Жыл бұрын
Awesome work, really looking forward to this foundry content
@formularyzer
@formularyzer Жыл бұрын
I watched your video again. I got it now, thanks for showing me integer flow!
@IssaNana-k4d
@IssaNana-k4d 9 ай бұрын
Thank you so much for this series
Жыл бұрын
Great content! I really appreciate! Thank you!
@meka4996
@meka4996 Жыл бұрын
Very good! Thank you
@jstechlead
@jstechlead Жыл бұрын
Great video! Quick question - can you please provide list of all vscode extensions, which you're using in VScode?
@smartcontractprogrammer
@smartcontractprogrammer Жыл бұрын
Prettier Solidity (Nomic Foundation)
@kiMANIM.1111
@kiMANIM.1111 Жыл бұрын
@@smartcontractprogrammer is their something special about solidity by nomic foundation that is not in solidity by juan blanco
@JustinBishop
@JustinBishop 2 ай бұрын
Where can i find the built in functions that foundry has? im writing a test for a tutorial hack contract that will interact with the target contract.
@smartcontractprogrammer
@smartcontractprogrammer 2 ай бұрын
book.getfoundry.sh/
@kevinnzeng7081
@kevinnzeng7081 Жыл бұрын
Terrific 💯 Thanks so much 🎉
@ramamuge3380
@ramamuge3380 Жыл бұрын
I'm also getting the same error of Undeclared Identifier when using the vm.expectRevert(stdError.arithmeticError)...can someone advice on the solution?
@smartcontractprogrammer
@smartcontractprogrammer Жыл бұрын
Maybe Foundry removed it in their latest version?
@UrosOgnjenovic
@UrosOgnjenovic 9 ай бұрын
import {Test, stdError, console} from "forge-std/Test.sol";
@SijoyThomas
@SijoyThomas Жыл бұрын
which ide is that? Visual Studio Code?
@smartcontractprogrammer
@smartcontractprogrammer Жыл бұрын
yes
@thurendous
@thurendous Жыл бұрын
I was wondering why dec() cost much less gas than inc(). Why?
@MrCoreyTexas
@MrCoreyTexas 4 ай бұрын
Great question, I have no idea either. I guess if you were writing a for loop to do something 10 times, it'd use less gas to go from 10 to 1 than from 1 to 10?
@MrCoreyTexas
@MrCoreyTexas 4 ай бұрын
I did this test and found the opposite result, going from 1 to 10 was cheaper than going from 10 to 1. I really don't know why dec() costs so little gas according to foundry.
@Okeh189
@Okeh189 9 ай бұрын
why do we write failing tests in foundry?
@smartcontractprogrammer
@smartcontractprogrammer 9 ай бұрын
Test that smart contract fails under certain conditions for example - revert if msg.sender is not authorized
@Okeh189
@Okeh189 9 ай бұрын
@@smartcontractprogrammer btw bro u know solidity well, do u work somewhere? or taking youtube as full time?
@MehreenMunsif
@MehreenMunsif Жыл бұрын
There is an error "undeclare identifier" when writing "vm.expectRevert(stdError.arithmeticError)". It seems like the foundry doesn't recognize this and says "Undeclared Identifier" for Do you know why?
@UrosOgnjenovic
@UrosOgnjenovic 9 ай бұрын
import {Test, stdError, console} from "forge-std/Test.sol";
Set Solidity Compiler Version | Testing with Foundry
3:30
Smart Contract Programmer
Рет қаралды 7 М.
Fuzz | Testing with Foundry
9:07
Smart Contract Programmer
Рет қаралды 4,7 М.
Quilt Challenge, No Skills, Just Luck#Funnyfamily #Partygames #Funny
00:32
Family Games Media
Рет қаралды 43 МЛН
coco在求救? #小丑 #天使 #shorts
00:29
好人小丑
Рет қаралды 78 МЛН
Don’t Choose The Wrong Box 😱
00:41
Topper Guild
Рет қаралды 31 МЛН
Delegatecall | Solidity 0.8
9:26
Smart Contract Programmer
Рет қаралды 25 М.
How to Write Neatly + Improve Your Handwriting
5:50
Charm
Рет қаралды 26 МЛН
Time | Testing with Foundry
9:00
Smart Contract Programmer
Рет қаралды 4 М.
Data Structure for Quantitative Finance in Python!
16:26
EthernetWink
Рет қаралды 659
The True Limit in Motorsports - Slip Angle Explained
13:34
Suellio Almeida
Рет қаралды 29 М.
Event | Testing with Foundry
10:33
Smart Contract Programmer
Рет қаралды 4,8 М.
Quilt Challenge, No Skills, Just Luck#Funnyfamily #Partygames #Funny
00:32
Family Games Media
Рет қаралды 43 МЛН