Skip to content

Instantly share code, notes, and snippets.

@Kilo-Loco
Created February 22, 2024 06:54
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Kilo-Loco/d879ce11e152fc2113a575f1c421a587 to your computer and use it in GitHub Desktop.
Save Kilo-Loco/d879ce11e152fc2113a575f1c421a587 to your computer and use it in GitHub Desktop.
First Smart Contract Wallet
// 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