2

Try this: data: myContract.methods.setValue(123,'ABC').encodeABI() BTW, you'll first need to unlock on your node the account that you specify in the from field (otherwise, you'll need to use web3.eth.sendSignedTransaction instead).


2

Your account holds 0.000068371576646932 ether, which is 68371576646932 wei. With: value: 1000000000000 gasLimit: 21000 gasPrice: 8000000000 You tell the node that you are willing to spend at most 21000 * 8000000000 + 1000000000000 wei. But since 21000 * 8000000000 + 1000000000000 = 169000000000000 > 68371576646932, your transaction cannot be ...


2

As for the fees, I'm not entirely sure whether they are calculated in the transfer-network token, or in the original token: The fee is given in either the native currency of the associated network, or, for token transfers, the token itself. Anything marked as ERC20 is an ERC-20 token on the Ethereum main net. Fees are paid in that token. Anything marked as ...


2

There was no problem with the send request that I have written. The problem was with the provider, which I have not assigned properly. In my web3.js file, previously this was written: web3 = new Web3(window.web3.currentProvider.enable()); I changed this to: await window.web3.currentProvider.enable(); web3 = new Web3(window.web3.currentProvider);


2

It does have a transfer function, you just don't see in the contract because the author has used the Upgradable Contract design-pattern, which (as implied by its name) allows him/her to upgrade the contract. Here are a few more examples of ERC20-Token contracts which were implemented the same way: BUSD Token AMPL Token USDC Token REP Token TUSD Token SNX ...


2

Yes you can but you should be aware of some things. A simple ether balance transfer will still run some contract code. Because code runs, there are ways a user can be tricked to run code that harms the user: for example, a user could be tricked to lose their tokens..


1

Metamask is simply a signer(provider + wallet) that interacts with other nodes. You can simply use the ethers.js library using a third party API providers like Alchemy/Infura and write automated scripts to interact with those API nodes. ERC20/ERC721 transfers are just contract interactions and can be done via the same ethers.js scripts. You can also use your ...


1

You should be using a frontend facing library like ethers.js which may or may not require a connection to a node provider.


1

Metamask is a browser extension, thus its scope is only within a browser. You can write automation scripts but that's going to be too cumbersome and unstable. A better alternative would be to use something like hardhat that can connect to a JSON-RPC node to send your transactions. It's javascript so you can easily create custom scripts for different ...


1

You randomness generation will not work. You rely on now (alias of block.timestamp, the timestamp when the block including your transaction was mined, https://docs.soliditylang.org/en/v0.4.21/units-and-global-variables.html#block-and-transaction-properties), which is not going to change in your loop. Instead, you could derive 10 different public keys, see ...


1

You should get the transaction receipt after an execution. Try this: let options = { to:receiveAddress, from:web3.eth.defaultAccount, value:BNAmount, chainId:chainid, gas:21000, gasPrice:currentGasPrice, nonce:nonce } // using the promise web3.eth.sendTransaction(options) .then(function(receipt){ console.log(receipt) }); ...


1

Check if the transaction was initiated by another wallet (using transferFrom). If thats the case cancel all your approvals and you should be fine (im assuming tokens on the chain you're on work the same way they do on ethereum, if thats not the case my answer is irrelevant and im sorry). If no that means someone has direct control over your wallet and you ...


1

function mintToken() private private means the function can only be called from within the contract itself, try to change it to public or external and it should work


1

I gave up trying to ethereumjs-tx in the end as I came across this: https://stackoverflow.com/questions/64526925/how-to-swap-tokens-on-uniswap-using-web3-js Managed to get that solution up and running it solved that particular error I was getting.


1

Geth nodes can configure what transactions they are willing to accept in their txpool. See the Transaction Pools Options section here. You did not give much details, but I can speculate on a few reasons that could explain a delay. The node txpool global slots or accounts slots was full and your gas price was not high enough to replace another pending ...


1

The steps to send an ERC-20 token are: Get the deployed contract instance. Get the amount to send, the receiver, and the sender. Invoke the ERC-20 contract's transfer function. Code for the above steps are: Step 1: use Web3\Contract; $contractAddress = 'ERC-20 contract deployed address' $contract = new Contract('http://localhost:8545', $abi); ...


1

A quick look at the docs (scroll down a bit to the code examples) show that you should be invoking sendTransaction on the raw tx object - you don't need to call signTransaction first. You can also see this more formally in a little bit above in the docs here. For the record, you mentioned checking Rinkeby for the tx. You've put in chainId: 42 in the tx ...


1

Looks like it uses some sort of a proxy. They claim to be ERC20 compatible so they have to have transfer function - it just might not be listed due to their proxy pattern. I'm not familiar with how their system works but if I understand correctly the even say that it's not so obvious in their github: Because the implementation address in the proxy is a ...


1

You can npm install web3@1.2.1, and then try this NodeJS script: const Web3 = require("web3"); const NODE_ADDRESS = process.argv[2]; const DEST_ADDRESS = process.argv[3]; const WEI_AMOUNT = process.argv[4]; const PRIVATE_KEY = process.argv[5]; async function scan() { return await new Promise(function(resolve, reject) { process.stdin.resume()...


1

About 1. for creating fresh addresses you can use keythereum or ethers.js. Take a look on both libraries and pick the one you prefer. About 2. and 3. To track the payments I see 2 options: You will be using nodejs so you can setup nodejs cronjob and check in block range ({fromBlock: X, toBlock: 'latest'}) the new transactions that sent ethers to your main ...


1

The gas limit for a block is around 8 million, but you tried to send a transaction with a gas limit of 200 million gas.


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