Skip to content

Instantly share code, notes, and snippets.

@Apolloelephen
Created February 24, 2024 17:48
Show Gist options
  • Save Apolloelephen/a3cc42b18681e73e08301420e2d029dc to your computer and use it in GitHub Desktop.
Save Apolloelephen/a3cc42b18681e73e08301420e2d029dc to your computer and use it in GitHub Desktop.
a simple Deposit Contract.
/ 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