1

You can use HDWallet Provider. const Web3 = require('web3'); const myContract = require('./build/contracts/myContract.json'); const HDWalletProvider = require("@truffle/hdwallet-provider"); const mnemonicPhrase = 'country roads take home ....'; const init = async () => { const provider = new HDWalletProvider({ mnemonic: { ...


1

You can speed up the transaction and make it go through faster. On MetaMask, click on the transaction that is processing and there will be an option to "Speed up". Click this and it should go through much faster!


1

I don't know of any template, but this can be done relatively easily with solidity. Consider the dummy code below: pragma solidity ^0.8.0; /*your code here*/ // private function because it simply calculates commission and pays out accordingly. // Inputs & other validation likely will come from somewhere else in the contract. function takeCommission(...


1

Any guesses as to what in the hell type of a contract is paying out 40+ Ether at a time upon request A contract that is selling NFTs. If you look at the top (internal) transaction in that list (this one), you'll see a series of transfers. If you look at the Input Data field, you'll see the called function: Function: acceptBid(address _originContract, ...


1

If the function name and parameters are known it should be possible to create a dummy contract and generate a minimal ABI with Remix. Then use Remix connected to Metamask or a wallet like MyEtherWallet and MyCrypto.


1

It does not work because as you said A and B addresses are not stored in B and A. The exemple you linked his about compilation and importing, and cannot works in test (infinite loop and no setup for a and b values). Something like that should do the trick for the setup but be aware that the infinite loop is still present contract InterfaceOfA { ...


1

You can call the Uniswap's contracts directly. Specifically, you should call the Router02 contract, which handles all the details. Depending on your use case, you need to decide which function to call, since there are many variants. You can find the documentation at https://uniswap.org/docs/v2/smart-contracts/router02/ You will need some way to create a ...


1

As previously stated from the other answers, they use CREATE2. That happens because when you receive ERC-20 or any other token on a unique address, from a business perspective, it is very operationally costly, as they would need to top up these accounts with funds to be able to pay the GAS fees to sweep the tokens out to a centralised cold wallet. With the ...


1

As answered by Alexey, the error happens because of undefined defaultAccount property. The work around for it in javascript is adding the below statement web3.eth.defaultAccount = ethereum._state.accounts[0] Here we have used ethereum._state.accounts[0] instead of web3.eth.accounts[0] since it is deprecated to be used by metamask as documented in the ...


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