Git Product home page Git Product logo

ether-test's Introduction

Simple smart contract and JS scripts

Init:

git clone https://github.com/vitalii427/ether-test.git
cd ether-test

yarn

Compile smart contract:

npx hardhat compile

Run smart contract tests:

npx hardhat test

Deploy smart contract:

# run local test node
npx hardhat node

# deploy
npx hardhat run scripts/deploy.js

Etherscan task 1

Block 13507871:
1. Mined by 0xea674fdde714fd979de3edf0f56aa9716b898ec8 (Ethermine)
2. Block contains 74 transactions
3. Transaction sent by 0x71660c4005ba85c37ccec55d0c4493e66fe775d3 (Coinbase 1):
        0x2ad2bb00718ab0ed8310dacff9c029ea5d41e038d96c9f52561a1e7948759e99 

Run Script1

node script1.js

Output:

Transaction details for 0x2ad2bb00718ab0ed8310dacff9c029ea5d41e038d96c9f52561a1e7948759e99:
To Address: 0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48
Gas Price: 0.000000272978274689 ether
Block Number: 13507871
Block Miner: 0xEA674fdDe714fd979de3EdF0F56AA9716B898ec8
Raw Input Data: 0xa9059cbb0000000000000000000000003be960fef469fee13a34a475f5b57e9ec2a9899800000000000000000000000000000000000000000000000000000000066ff300
ERC20 call details for 0x2ad2bb00718ab0ed8310dacff9c029ea5d41e038d96c9f52561a1e7948759e99:
Token Name: USD Coin
Token Symbol: USDC
Token Decimals: 6
Call: transfer(0x3Be960FEF469FEe13A34A475f5b57E9ec2A98998,108000000)
        - transfer() recipient address: 0x3Be960FEF469FEe13A34A475f5b57E9ec2A98998
        - transfer() amount: 108.0 USDC
Encoded input data to transfer 100 USDC to 0x85b931A32a0725Be14285B66f1a22178c672d69B:
        - 0xa9059cbb00000000000000000000000085b931a32a0725be14285b66f1a22178c672d69b0000000000000000000000000000000000000000000000000000000005f5e100

Etherscan task 2

Next block mined by 0xea674fdde714fd979de3edf0f56aa9716b898ec8 is 13507875

Run Script2:

node script2.js

Output:

Max Sender: 0x46340b20830761efd32832A74d7169B29FEB9758 [15 sends]
Max Receiver: 0xA090e606E30bD747d4E6245a1517EbE430F0057e [97 recvs]
Max Gas Price: 0.000000324 ether

Sepolia testnet

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.