Created
February 22, 2024 06:54
-
-
Save Kilo-Loco/d879ce11e152fc2113a575f1c421a587 to your computer and use it in GitHub Desktop.
First Smart Contract Wallet
This file contains hidden or 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 EtherWallet { | |
address payable public owner; | |
modifier onlyOwner { | |
require(msg.sender == owner, "Only the owner can complete this opporation"); | |
_; | |
} | |
constructor(address payable _owner) { | |
owner = _owner; | |
} | |
function send(address payable receiver, uint amount) public onlyOwner { | |
receiver.transfer(amount); | |
} | |
function deposit() payable public {} | |
function checkBalance() view public returns(uint) { | |
return address(this).balance; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment