From a4e1b3e2e0173720614fce5e5a8ea6210d01dca2 Mon Sep 17 00:00:00 2001 From: Lucas Oliveira Date: Sun, 22 Sep 2024 23:26:33 -0300 Subject: [PATCH] add error in example contract --- README.md | 2 +- smartcontracts/src/Counter.sol | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index ccdd7db..beacf1e 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# Fullstack Web3 Template v2.1.0 +# Fullstack Web3 Template v2.2.0 ## QuickStart diff --git a/smartcontracts/src/Counter.sol b/smartcontracts/src/Counter.sol index 95e936b..92a7f51 100644 --- a/smartcontracts/src/Counter.sol +++ b/smartcontracts/src/Counter.sol @@ -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); + } }