Skip to content

Commit

Permalink
add error in example contract
Browse files Browse the repository at this point in the history
  • Loading branch information
olivmath committed Sep 23, 2024
1 parent f1570aa commit a4e1b3e
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Fullstack Web3 Template v2.1.0
# Fullstack Web3 Template v2.2.0

## QuickStart

Expand Down
6 changes: 6 additions & 0 deletions smartcontracts/src/Counter.sol
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,10 @@ contract Counter {
function increment() public {
number++;
}

error CustomError(string message, uint256 yourAmount);

function getError(uint256 yourAmount) public pure returns (string memory) {
revert CustomError("An error occurred", yourAmount);
}
}

0 comments on commit a4e1b3e

Please sign in to comment.