1

Unsure if you mean deployed contracts or undeployed/templates. Here are my takes for both. Deployed: Uniswap (all versions) Opensea contracts MetaMask swap Aave Undeployed/templates: OpenZeppelin ERC20 & ERC721 Gnosis Safe


1

Keyword payable in the function is needed to make the function able to receive ether. Sending ether is possible from any function, as long as the address sending is payable.


1

This kind of things are simply easiest to try out in something like Remix. I tried all three variants: as-is, explicitly setting i and explicitly setting result . The first two cost the same (25315), and the last one costs 25323. Honestly, I'm really not sure why it's like this.


1

The key to solving this (how we do it at least) is using array indexes. It's still tricky as in Solidity we are very limited in what we can do with arrays, there is no way to slice, flip etc. Here is a working approach. (Note: this assumes you fulfil randomness via chainlink or otherwise in the getRandomNum function. Modify accordingly.) // your array which ...


1

Each web3 javascript library will expose the contract methods in its own way. From the intro page of Ethernaut: ethernaut is a TruffleContract object that wraps the Ethernaut.sol contract that has been deployed to the blockchain. We can see that their contracts are instantiated as @truffle/contract which has a method calling procedure that looks like: ...


Only top voted, non community-wiki answers of a minimum length are eligible