EtherVault is a secure and efficient smart contract built on Solidity that allows users to deposit and withdraw Ether. The contract includes robust features such as restricted access for administrative functions, individual balance tracking, and event logging for transparency. It is a demonstration of Solidity skills and secure coding practices, showcasing ability to design, deploy, and test smart contracts professionally.
- Deposit and Withdraw: Users can deposit Ether to the contract and withdraw their balances anytime.
- Owner Privileges: The contract owner has exclusive rights to withdraw all funds from the contract.
- Event Logging: Emits events for deposits and withdrawals to provide transaction transparency.
- Balance Tracking: Maintains user-specific balances securely.
- Test Coverage: Includes comprehensive test cases using Foundry for deposit, withdrawal, and edge-case scenarios.
Network: Sepolia Testnet
Contract Address: 0x87c625aD3269636DCfb656D9b072825015d609cF
EtherVault/
├── src/
│ ├── EtherVault.sol # Main smart contract
├── test/
│ ├── EtherVault.t.sol # Comprehensive test suite
├── README.md # Project documentation
- Install Foundry for Solidity development and testing.
- A funded wallet for interacting with the deployed contract on the Sepolia testnet.
- Clone the repository:
git clone https://github.com/NishantCoder108/EtherVault.git cd EtherVault
- Deploy the contract:
forge create --rpc-url <your_rpc_url> --private-key <your_private_key> src/EtherVault.sol:EtherVault --constructor-args <owner_address>
- Deposit: Send ETH to the contract using the
deposit
function. - Withdraw: Call the
withdraw
function with the desired amount. - Owner Withdraw All: The contract owner can withdraw all funds using the
withdrawAll
function.
The project includes a complete test suite written in Foundry to ensure correctness and security:
- Run tests locally:
forge test
- Test cases include:
- Initial setup validation
- Deposit and withdrawal scenarios
- Edge cases for invalid actions
- Owner-specific functions
- Solidity Development: Demonstrates proficiency in designing secure and efficient smart contracts.
- Testing with Foundry: Comprehensive test coverage for robust code quality.
- Professional Practices: Emphasis on readable code, event logging, and clear error messages.