New answers tagged

0

It seems the only way to have "gasless" txs go through contract side is through the implementation of OpenGSN - https://docs.opengsn.org/ Some of their examples are totally broken and I will update the answer with more relevant information on how to easily do it in a code snippet.


0

Easy way: https://cointool.app Harder way: Source code: https://github.com/rstormsf/multisender/blob/master/contracts/contracts/multisender/UpgradebleStormSender.sol function multisendToken(address token, address[] _contributors, uint256[] _balances) public hasFee payable { uint256 total = 0; require(_contributors.length <= arrayLimit()); ERC20 erc20token ...


0

The question was asked in February 2018, that seems like an ancient history in the Etheruem space. Key terms "meta transactions" and "gas station network": https://opengsn.org/ https://docs.openzeppelin.com/learn/sending-gasless-transactions EIP-1613: https://eips.ethereum.org/EIPS/eip-1613 Recent examples of gasless token sends: USDC ...


0

If you're looking for such a table for the purpose of golfing down contract gas cost, I'd recommend you bookmark protocol_params.go. It is good for two reasons: It is the source of truth. The gas costs specified in that file are what a full node really meters. It lists the important numbers you really need. For example, the usual gas table doesn't show how ...


0

Updated Answer My transaction will be executed first. But will I pay 1 Ether per GAS or is there something automatic saying I will only pay only 0.51 for example? The amount you pay will not be reduced based on the other bids. Original Answer There is no maximum limit to gasPrice. The gas you end up paying is gasPrice * gasLimit. For a normal transaction, ...


0

I think you can find the answer in following link It seems like they use a binary search to calculate estimated gas based on the opcodes.


0

Is it possible to pre-execute it in order to see if it fails? Not really: Yes: in a contract function, you can call another contract function without reverting, get a status of whether or not it has failed, and handle that as desired No: if it hasn't failed, then it means that it had already executed For example: pragma solidity 0.6.12; contract A { ...


2

You could just use a smart contract which collects all the assets inside it. Because you mentioned fiats I assume the users are storing the fiat in a centralized exchange and then transferring it to their own wallet - since they can't deposit fiat directly to an Ethereum address. When the Ethers are in their own wallet the could interact with your contract. ...


0

I am not sure I understand where the 21k limit comes from / how it is calculated 21K gas is not a gas-limit, but the minimum gas-cost for a transaction which is sent from an externally-owned account (i.e., from the off-chain). This restriction does not apply for a transaction which is sent from a smart-contract account (i.e., from the on-chain).


1

The problem is that Launchpad transfers ethers to Layerx using .transfer, so the receiver has 2300 gas stipend payable(_stakeFeeAddress).transfer(stakeFeeAmount); Since Layerx fallback modifies storage it requires more than the 2300 and it cause out of gas error making setupLiquidity revert function() external payable { ethToNextStake = ethToNextStake....


1

You actually don't need to create/manage private keys for users or pay for their transactions when receiving tokens: you just need a contract that receives tokens (or ethers) so that you can manage afterwards what to do with them. Below is an example of a simple smart contract that registers ERC20 token addresses and receives either ERC20 tokens or ethers: //...


0

OpenEthereum node (used to be called Parity) exposes an API to get receipts for all transactions in a block using a single API call: parity_getblockreceipts.


0

Class BN does not support decimals, as stated in the official documentation: Note: decimals are not supported in this library. So change this: gasAmount.div(new BN(1.30)) To this: gasAmount.mul(new BN(130)).div(new BN(100)) Or even to this: gasAmount.muln(130).divn(100)


2

Web3.js lib is already supporting BigNumber so you don't have to add the library twice. Try this: const gasAmount = web3.utils.toBN(132876); console.log(gasAmount.divn(1.30).toString());


Top 50 recent answers are included