Created
February 24, 2024 17:48
-
-
Save Apolloelephen/a3cc42b18681e73e08301420e2d029dc to your computer and use it in GitHub Desktop.
a simple Deposit Contract.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/ SPDX-License-Identifier: MIT | |
pragma solidity ^0.8.24; | |
contract Deposit { | |
// this maps the balance to the address of the depositor | |
mapping(address => uint256) public balances; | |
function deposit() external payable { | |
require(msg.value > 0, "Amount Deposited must be greater than 0"); | |
balances[msg.sender] += msg.value; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment