New answers tagged

0

Try working through the connection documentation here: https://developer.trustwallet.com/wallet-connect


0

v1.9.24 no longer has whisper, it has been trashed since v1.9.21. You should use a previous version. (like v1.9.17)


0

If you look through the comments on OP's question, it becomes clear that there was an issue with the ABI the OP was originally using (h/t @Ismael) - perhaps it was copy pasted incompletely, or maybe there was some file corruption. By regenerating the ABI, the code worked as expected.


-1

enode://a9a95b83e056f7e938331e6f2da4835b1d5a9af2e22dfedeab9e0b388a92698d9af419f557d22c349d09f82ad33d3b070ec6ab74b60787021738803369a9772e@62.171.150.91:30303[-1]/Export%20JSON%20File%E2%80%99d


-1

ipfs resolve -r /ipns/app.uniswap.org/0x00000000219ab540356cBB839Cbe05303d7705Fa: webhook/0x00000000219ab540356cBB839Cbe05303d7705Fa" under QmNaS1tmxY9WBwv5Mu9oMWnWNvJ2hQKvyu4L2tbg3AWRXV


0

You probably need to define your requirements and explain why you need a backend. If you manage all web3 interactions from the backend, you will also have to manage wallets / private keys, assume transactions costs... and not sure this is what you want. From my perspective: Frontend: You can use web3 (web3.js or ethers.js) to connect to a browser plugin ...


0

You're missing from and to parameters inside the txObject object. These parameters are the address of the transaction sender and the address of the transaction receiver.


0

The function web3.eth.sendTransaction can be used to transfer directly to the contract receive function. web3.eth.sendTransaction({ from: USER_ADDRESS, to: CONTRACT_ADDRESS, value: AMOUNT_IN_WEI, gas: GAS_AMOUNT }) .then(function(receipt){ ... });


1

May be it is a bit late to answer but for others if they need in future. I had a typo in --datadir and --networkid. Hope it helps!


0

I have similar issue, maybe the deadline, should be unix timestamp? To should be the address, which you want it to receive the LP token


0

Could you explain this a little more to me like how to run this script within a cold wallet like atomic wallet is this possible? I could surely use the help 2 of my wallets where hacked somehow and in one them I had uni token 800 of them and they where withdrawn as of today that's like 25k I lost this guy still deposits daily in the two wallets I'd sure ...


1

As you are connected to the Ropsten testnet you have to change const tx = new Tx(txObject) to const tx = new Tx(txObject, { chain: 'ropsten' }). Without the { chain: 'ropsten' }, ethereumjs-tx signs a mainnet transaction. Your code does not work because you are basically trying to send a mainnet transaction whereas your web3 provider connects to the Ropsten ...


0

I'm embarrassed to report that I found my problem. It had nothing to do with the Truffle contract abstraction or web3.js contract object. The problem was in the web3.js function estimateGas. This function doesn't just give you a gas estimate, it simulates the transaction and so throws any errors that the function call would throw when used in anger. So, when ...


2

To obtain blockchain information, it must be connected to a node. The role that connects to the node is Provider. Even if there is no Metamask, the Provider must exist. Local Provider or Infura Providier can be set. The way to call view or pure function without signature is to use web3 call. Refer to the link below for using web3 call. https://web3js....


0

It will depend on your current infrastructure. The handicap here is when the user closes the page, so you somehow need to store the transactions backlog and recover it when the user is back. Below are some alternatives I used in former projects: Front-end only: you can use the local storage to save the transactions. Front-end & Back-end: you can use a ...


0

I was able to figure this out after much debugging. Turns out that the chainid OPCODE is not working correctly in Ganche (if you use their UI - the fix has been released in the ganache-cli project). The lack of a proper functioning chainid results in the DOMAIN_TYPEHASH being computed incorrectly which prevents ecrecover from generating the correct address ...


1

Nevermind, I found the issue. The javascript code I posted is a little differrent. In the original code, I was fetching the contractAddress using web3.getTransactionReceipt(..).then(function(receipt){ contract = .... (receipt.contractAddress)}); This code worked in the first version of my contract, but when the contract was updated, obviously the address ...


0

That file contains the private key encrypted with a password. Once the private key is decrypted the address can be derived from it. If the decryption fails or the address is not the same then the file was tempered with.


1

Yes, you can generate one Wallet contract per every EOA of your user, and this contract may act on behalf of the user, being the user who controls it with its signature. To see an example, check Augur's Wallet contracts here: https://github.com/AugurProject/augur/blob/0a12a20a3ab0f4a822ec2c5070136e3e4a8180c4/packages/augur-core/src/contracts/...


0

To handle Confirm/Cancel response of user on your contract functions, you can use the transactionHash event & error event from send function. "transactionHash" returns transactionHash: String: Fired when the transaction hash is available. "error" returns error: Error: Fired if an error occurs during sending. If the transaction was ...


0

It would help if you add the code of your ERC20 definition (specially the import you do from OpenZeppelin). However, I already bet that you seem to be using an ERC721 token rather than ERC20 one (and Uniswap only accepts ERC20 or Ether). Notice that your approve function matches with ERC721 standard: function approve(address _approved, uint256 _tokenId) ...


0

You gotta do this in this order if you want to send token into a contract mytoken.methods.approve(contractAddress, amount).send({from: accounts[0]}).on('receipt', (receipt) => { myContract.methods.transferFrom(tokenOwnerAddress, contractAddress, amount). send({from: accounts[0]}).on('receipt', (receipt) => { // do something ...


1

this solution is working for me: web3.currentProvider.sendAsync({ jsonrpc: '2.0', method: 'evm_unlockUnknownAccount', params: [address], id: new Date().getTime() }, console.log);`


1

Came to know that WSL-2 cannot connect to the localhost directly. See this and this. WSL-2 has its own port to listen to. Ganache gives you the option to select that port instead of localhost. Go to Settings > Server > Hostname > 172.23.160.1 - Ethernet (WSL) Can use the command provided by @Ismael above in the comments to check if the port is ...


0

You can find the canonical definition of the deposit signature in ethereum/eth2.0-specs: process_deposit. Specifically, it is this code: # Verify the deposit signature (proof of possession) which is not checked by the deposit contract deposit_message = DepositMessage( pubkey=deposit.data.pubkey, withdrawal_credentials=deposit.data....


0

Thanks @MajdTL for the clarification. I understand now that the unlockAccount(...) method actually unlocks the account for everyone on the blockchain and not just for the client on the browser. There is a way to use simply the keystore json file that is generated when an ethereum account is created. load the keystoreV3 json into a js object, say keystore. ...


1

Hi i encountered the same problem as of your's my code with error const hdwalletprovider=require('truffle-hdwallet-provider'); const Web3=require('web3'); const {interface,bytecode}=require('./compile'); const provider=new hdwalletprovider( 'hello blue aunt noob root name model brave fully sail trumpet pint', 'https://rinkeby.infura.io/v3/...


1

Doesn't seem to be an issue on your code, but rather about your setup in which you don't have peers to connect in your configuration files. You may try to update your peer nodes.


1

By reading at the contract, there are essentially two roles: > Seller: this is assigned inside the constructor, meaning that only the person who deployed this contract becomes a seller: constructor() payable { seller = payable(msg.sender); // Contract creator becomes seller value = msg.value / 2; require((2 * value) == msg.value, "Value ...


0

yes, it is retrieving peers from your previous sessions from local database. use --maxpeers=0 you can also try to drop peers from the console


1

Anyone who arrived here from having a solidity-coverage error when running truffle coverage and having it fail verus truffle test and having that succeed, the answer is correct, change .sendAsync to .send. It takes longer to run, but works. It seems like the injected web3 instance during the coverage plugin is slightly different to the web3 instance during ...


1

When sending a transaction from an EOA (Externally Owned Account) it always has just one destination with one function call. So you would need to send multiple transactions that way, to interact with multiple contracts. However, contracts don't have such limitations. A contract can do as much stuff as it wants, as long as the gas limits are respected. So you ...


2

This touches several parts of how Ethereum works. I'll try to explain it in an understandable way: 1.) Ethereum has "externally owned accounts" (EOAs) and "contract accounts". EOAs are much like normal bank accounts. They have an address (IBAN) and a balance (in Ether). Essentially, the EOAs owner possesses a public key pair, of which ...


1

An EOA has always a private key to sign the transactions. So if you plan to use one common EOA (your backend manager) then the sender of all transactions would be that EOA - and that one would also pay all gas fees. If you wish to get some Ethereum assets (either Ethers or some tokens) from the users as payments, the users need their own wallets (EOA) from ...


0

Btw you can now open a ticket with truffle support: https://www.trufflesuite.com/community https://trufflesuite.zendesk.com/hc/en-us/requests/new


0

A smart-contract is a passive software object that, on its own initiative, cannot request anything from anyone. A smart-contract is activated by a transaction sent to its address. The smart-contract cannot directly request anything on the Node, but it can emit an Event containing the request required for the smart-contract. The corresponding Node catch the ...


0

Not sure if I totally understood your question but you can take a look at the Solidity Documentation Contract ABI Specification: https://docs.soliditylang.org/en/latest/abi-spec.html#examples To see how to encode the parameters on your own. It is basically a big concatenated strings set of function name hash and function arguments. You can also take a look ...


0

Finally I found the solution.. The issue was caused by the ABI. I was using the ABI as generated by the compiler (the one I mention to my initial post). I switched to the ABI as generated by remix and it worked. There were some slight changes to the output types.


0

Another solution to your problem We can also use this method to add wallet in our eth.wallets Points to be look at :- We are taking values of interface and bytecode from another file which is having our contract code compiled in it. hdwalletprovider input your 12 word mnemonic and rinkeby address `const hdwalletprovider=require('truffle-hdwallet-provider');...


-2

you can try Web3 please check this out: https://medium.com/metamask/calling-a-smart-contract-with-a-button-d278b1e76705


0

First of all you should login your eth account like below const keystore = fs.readFileSync("your keystore path", "utf8"); var activeAccount = web3.eth.accounts.decrypt(keystore, password); Now you can sign and broadcast your transaction. You must encode your swap message and add your tx's data field. Don't miss eth amount how many want ...


1

You can also use the web3 CLI in case you get the error require is not defined. <script src="https://cdn.jsdelivr.net/gh/ethereum/web3.js@1.0.0-beta.36/dist/web3.min.js" integrity="sha256-nWBTbvxhJgjslRyuAKJHK+XcZPlCnmIAAMixz6EefVk=" crossorigin="anonymous"></script>


0

The metamask.js script seems incorrect. There isn't enough code to test but you have to do something like this const oldProvider = web3.currentProvider; // keep a reference to metamask provider myWeb3 = new Web3(oldProvider); // now you can use myWeb3 instead of web3 If the project is large you may want to replace web3 with myWeb3. global.web3 = myWeb3


Top 50 recent answers are included