Thanks to visit codestin.com
Credit goes to github.com

Skip to content

moonstar-x/eth-kipu-bank

Repository files navigation

KipuBank

This repository contains a simple contract as a proposed solution for the KipuBank module activity from the Blockchain course provided by ETH Kipu.

Requirements

In order to develop for this repository you will need the following:

You will also need an account in MetaMask, Alchemy, and Etherscan.

Setting Up

First, clone this repository:

git clone https://github.com/moonstar-x/eth-kipu-bank

And install the dependencies:

npm install

Testing

To run unit tests for this project, run the following command:

npm run test

You may also run tests in Solidity only with:

npm run test:solidity

Or only in Node.js with:

npm run test:ts

Linting

To run the linter, use:

npm run lint

And to auto-fix issues, use:

npm run lint:fix

Formatting

To run the formatter, use:

npm run format

And to auto-fix issues, use:

npm run format:fix

Deploying

Follow these steps to deploy and verify this contract.

First, copy the .env.sample file into a .env file and fill out the values as necessary:

KIPU_BANK_CAP=300
KIPU_BANK_MAX_SINGLE_WITHDRAW_LIMIT=150
KIPU_BANK_OWNER_ADDRESS=0xA9A7c8E80D6A6b7ca89bB1d34f160acb62de457A
KIPU_BANK_ETH_USD_PRICE_FEED=0x694AA1769357215DE4FAC081bf1f309aDC325306
KIPU_BANK_USDC_TOKEN_ADDRESS=0xf08A50178dfcDe18524640EA6618a1f965821715

Feel free to change any variables to your liking.

As for the next variables:

Once you have your .env file ready, you're ready to deploy the contract by running the following command:

npm run deploy:sepolia

This will deploy the contract to the Sepolia testnet and will give you a contract address.

Once this is done, you can verify the contract with:

npm run verify:sepolia

This will verify the contract on Etherscan.

Interacting with the Contract

Available Deployments (Sepolia Network)

First, head over to the Etherscan page of the contract and copy the ABI content.

Next, head over to the Remix IDE and paste the ABI content into a .abi file with any name and leave this file open in the editor.

In the Deploy & Run Transactions page, Injected Provider - MetaMask in the Environment option and connect your wallet, make sure to enable only the Sepolia network when granting access.

Next, in the At Address textbox insert the contract's address and click the At Address button. You will receive a modal asking whether to load the contract with the ABI specification loaded, click Accept and you'll now have some buttons to interact with the contract.

About

Course Project for ETH-Kipu

Resources

License

Stars

Watchers

Forks