New answers tagged

0

For the first 2 question, here is what I know: Yes and no, when you create a new contract, you send the bytecode of that contract to the ethereum so everybody will know about the contract so you can store the contract bytecode elsewhere with geth. So technique the bytecode is always on the ethereum through the contract creation transaction, but you will ...


0

It is not possible to submit a transaction with gas larger than the block gas limit. The gas field indicates the maximum gas you will pay, if it is too large the miner cannot include the transaction in a block and will drop it. Transaction underpriced indicates there's a pending transaction and you are sending a replacement. To replace a pending transaction ...


0

Getting back to the exact source code of an unverified smart contract is, unfortunately, not possible. Your best bet is to use a bytecode decompiler like the one you used (Etherscan's solution). As an alternative I can also recommend EtherVM: https://ethervm.io/decompile


1

It sounds like you want to just fill an order but your code is attempting to do it through meta transactions, which is what executeTransaction() does. To execute a fill through a meta-transaction, the taker will need to sign the meta-transaction object as well, and that is the signature that goes into executeTransaction(). @0x/order-utils has helpers for ...


0

Try using this solidity code: https://github.com/PatrickAlphaC/brownie_fund_me/issues/1 // SPDX-License-Identifier: MIT pragma solidity ^0.6.6; import "@chainlink/contracts/src/v0.6/interfaces/AggregatorV3Interface.sol"; import "@chainlink/contracts/src/v0.6/vendor/SafeMathChainlink.sol"; contract FundMe { using SafeMathChainlink ...


0

So on the blockchain, time is a very difficult thing to capture as every node (Computer) can have a different time. And with this I mean split second differences. So how we do it on the blockchain is we use a certain block height/block number and its estimated epoch time. We can use this for time, because we have a rough estimate on how long it will take ...


1

The formula in your question describes a gas cost for the total amount of memory allocated in a contract call (i.e. the biggest memory location that contains a nonzero value. Zeroing memory after using it does not decrease the total amount of allocated memory). Note this is in addition to the base 3 gas of an mstore opcode. In the above formula, a is the ...


1

HECO blockchain recently implemented something like this. HECO is an Ethereum fork modified to implement POSA and other features. As far as I know, nodes are probably all controlled by Huobi (CEX). Last june, they implemented a hard fork that allowed to blacklist addresses and, similarly to what you want, to only allow a whitelist of addresses to deploy ...


0

I managed to solve this issue by issuing new transactions where I sent 0 ETH to myself, starting from the lowest nonce. For some reason it did not work in MetaMasks but it did work using Trust Wallet.


1

I had exactly the same issue and managed to solve it by passing correct ABI object. Looks like earlier versions of solc returned ABI as a JSON string and current version returns actual JavaScript object (but I'm not sure). So you can't just print contract's ABI and paste it to web3 instance (as I did). I had to JSON.stringify returned object first and then ...


1

Keep only one SPDX license and remove others You have typos and extra brackets in the Token contract. Replace it with this - contract Token is ERC20 { address public admin; address public liquidator; constructor() ERC20("Token", "TKN", 10000000000000000000000000000) public { admin = msg.sender; } ...


1

When you compile a contract that calls external library functions, the compiler embeds the address of the library (or a placeholder for such an address) in its bytecode. It works this way no matter if you compile the contract and the library together. Linking to an already deployed library is actually the usual situation that any tool has to handle. If you ...


1

This error is specific to MEW 6, use their older version to resolve it: https://v5.myetherwallet.com/


2

I think you could use web3 to link the contract to be deployed to the library that is already deployed, as the following StackExchange answer suggests. code: const ConvertLib = artifacts.require("ConvertLib"); const MetaCoin = artifacts.require("MetaCoin"); module.exports = function(deployer) { ConvertLib.address = "0xabce987676......


0

In addition constant (view or pure) functions only cost gas if the constant (view or pure) function is executed or called by another external smart contract, that is not the owner of that function. But if it is called from within the smart contract that declared the constant (view or pure) function, then no gas will be used. Just like when you use a class ...


1

I think the main point you are missing is the middle word of EVM - Ethereum Virtual Machine. It's called virtual machine because it's a machine which is only emulated on physical machines. All client nodes form the EVM. Some nodes are only verifying transactions, and some nodes do the actual heavy lifting: executing transactions and including them in blocks -...


0

Add this code to top of your contract: contract Context { // Empty internal constructor, to prevent people from mistakenly deploying // an instance of this contract, which should be used via inheritance. constructor() internal {} function _msgSender() internal view returns (address payable) { return msg.sender; } function _msgData() internal view ...


0

Answer for Q1 If not specified, usually the value is in "wei". So "1 ether" would be 1000000000000000000 wei. You can use web3.utils to convert "ether"->"wei". web3.utils.toWei('0.01', 'ether')


0

If you need to control voting per match, you'll need to use a mapping as follows: mapping(uint16 => bool) matchBettingActive; ... function beginVotingPeriodForMatch(uint16 _match) public onlyOwner returns(bool) { matchBettingActive[_match] = true; return true; } function closeVotingForMatch(uint16 _match) public onlyOwner returns (bool) { // ...


0

Etherum account is defined as: // Account is the Ethereum consensus representation of accounts. // These objects are stored in the main account trie. type Account struct { Nonce uint64 Balance *big.Int Root common.Hash // merkle root of the storage trie CodeHash []byte } If it has CodeHash then it is a contract, if it doesn't then it ...


0

I have a hard time figuring out what you're trying to do exactly, are you trying to bet on 2 different games with the same address? If so are you the creator of the contract? Because the code is filled with things that prevent you to do so, and it seems very intentionnal to me. //The first require is used to check if the player already exist require(!...


0

There should be no error. Can you check: Is it the same contract you deployed main net? Are you selecting right compiler version for deploying to test net? If is there still error, please let me know.


Top 50 recent answers are included