CRYPTO NEWS

How to fund an address in foundry test

How can I fund an EOA inside a test case with Foundry.

Assume I have an NFT contract, want to test the minting functionality and I want to have an EOA that owns enough ether to mint, since users have to send ether to mint it.

Let’s say I have

contract NFTCollectionTest is Test {    ...    function testMint() public {       address someRandomUser = vm.addr(1);       vm.prank(someRandomUser);       nftCollection.mint{value: 0.01 ether}();       ...    } } 

But the test case failed. When I run the foundry test with more verbosity -vvvv I can see that "EvmError: OutOfFund"

How to install web3j command line to generate smart contract wrapper

I am trying to generate a simple smart contract wrapper using solc and web3j in ubuntu. I have downloaded the source as defined in https://docs.web3j.io/command_line.html Release package can be obtained from https://github.com/web3j/web3j/releases/tag/v4.1.0. I have download the source from https://github.com/web3j/web3j/archive/v4.1.0.zip After unwrapping the zip package I can’t find any bin directory as the document page shows::Listen

I am trying to generate a simple smart contract wrapper using solc and web3j in ubuntu.

I have downloaded the source as defined in https://docs.web3j.io/command_line.html

Release package can be obtained from https://github.com/web3j/web3j/releases/tag/v4.1.0.

I have download the source from https://github.com/web3j/web3j/archive/v4.1.0.zip

After unwrapping the zip package I can’t find any bin directory as the document page shows

unzip web3j-<version>.zip creating: web3j-3.0.0/lib/ inflating: web3j-3.0.0/lib/core-1.0.2-all.jarcreating: web3j-3.0.0/bin/ inflating: web3j-3.0.0/bin/web3j inflating: web3j-3.0.0/bin/web3j.bat 

How to get the bin directory?

How to fund an address in foundry test

Shopping cart
There are no products in the cart!
Continue shopping
0