Skip to content

Commit

Permalink
Merge pull request #45 from decert-me/0xdwong-patch-4
Browse files Browse the repository at this point in the history
fix: amount -> msg.value
  • Loading branch information
0xdwong authored Jul 10, 2024
2 parents 43936cf + 40aca05 commit 454a2a6
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion translation/en/4578ff5b-4dcb-4c28-8b5f-7456ed1ab0a4.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
{
"type": "open_quest",
"score": 10,
"title": "Write test cases for the DepositETH method of the bank contract to check the following:\n\n1. Assert that the Deposit event output meets expectations.\n2. Assert that the user's deposit amount in the Bank contract is updated correctly before and after the deposit.\n\nRequirement: Submit the complete source code of the BankTest.sol test contract directly.\n```\ncontract Bank {\n mapping(address => uint) public balanceOf;\n\n event Deposit(address indexed user, uint amount);\n\n function depositETH() external payable {\n require(msg.value > 0, \"Deposit amount must be greater than 0\");\n balanceOf[msg.sender] += amount;\n emit Deposit(msg.sender, amount);\n }\n}\n```\n"
"title": "Write test cases for the DepositETH method of the bank contract to check the following:\n\n1. Assert that the Deposit event output meets expectations.\n2. Assert that the user's deposit amount in the Bank contract is updated correctly before and after the deposit.\n\nRequirement: Submit the complete source code of the BankTest.sol test contract directly.\n```\ncontract Bank {\n mapping(address => uint) public balanceOf;\n\n event Deposit(address indexed user, uint amount);\n\n function depositETH() external payable {\n require(msg.value > 0, \"Deposit amount must be greater than 0\");\n balanceOf[msg.sender] += msg.value;\n emit Deposit(msg.sender, msg.value);\n }\n}\n```\n"
}
],
"startTime": "2024-03-11T13:13:09.179Z",
Expand Down

0 comments on commit 454a2a6

Please sign in to comment.