New answers tagged

0

Are you adding the network parameter in your brownie script call? If not, try doing so. Example... brownie scripts/interact.py --network rinkeby The ContractContainer will contain your deployments on the network that is specified in the parameter. If this parameter is left empty, then it will use the ganache-cli network. Since local network deployments are ...


1

What you are experiencing is just a bug of bscscan.com, not a rug pull at all. BSCScan tries to decode the input data using a custom-created ABI that does not correspond to the actual smart contract. (see below for reference). This error is present on every smart contract's deployment page. Please note that you need to read data directly from your local node ...


0

Assuming the main contract is CDOGE, compiling all the 16 files, one by one, in the order of dependency (you should compile prerequisite files first and continue the job, until you finish with the CDOGE) and then deploying the CDOGE bytecode/abi would be enough to do the job. The final CDOGE has all the prerequisites inside. Check this out. Test it with ...


0

Here are two other sources of information about NFT Lazy Minting. OpenZeppelin. There's also a 45-minute video tutorial on minting NFTs. https://blog.openzeppelin.com/workshop-recap-building-an-nft-merkle-drop/ Medium. "NFT Minting vs Lazy Minting. Minting explained. " https://medium.com/rarible-dao/nft-minting-vs-lazy-minting-mining-explained-...


0

What you are looking for is called "lazy mining" and it is supported by some of large marketplaces including Opensea. By far the best explanation of it that I have found is on this website


1

Usually the recommended approach is to emit an event with the contract address. Then you can read the event from the transaction receipt and get the address. event TokenCreated(address indexed a); function _createFNftToken( string calldata _name, string calldata _symbol, uint256 _amount, address _to ) private returns(address){ ...


0

First, check if your transaction's setup(gas/gas limit) is ok (see this). If everything is okay, the most probable issue might be the size of your contract. I suggest first take a look at this to get familiar with contract deployment's gas calculation. Now, note that each block has a limited size(currently it is 15 million gas). This means that you cannot ...


0

Connecting to the mainnet fixed the issue for me, seems the error is from mumbai cause the code works fine on both local and mainnet rpc. I know this isnt an optimal solution especially if you just wanna run some test but this is what worked for me and thought I should share.


2

Before doing anything, I suggest first take a look at this to get familiar with contract deployment's gas calculation. After reading the aforementioned link, I suggest (if it is possible for you), minimize your solidity code. Removing extra codes, results in less bytecodes, which means you will pay less for the deployment. Be warned that decreasing the ...


3

Sorry, that's the cost of working on L1. Consider how today's average gas for all transactions was ~130 gwei or ~$150 USD: https://ycharts.com/indicators/ethereum_average_gas_price. This includes simple send and cheap calls. I suggest deploying to an L2.


0

It happens to me when I type fast, I leave blank brownie run scripts /fileName.py It should be brownie run scripts/fileName.py


0

Encountered exactly the same problem (all methods returning empty arrays) and was driving me mad. The solution (the one I found anyway) was to stringify the abi resulting from the solc compiler (as mentioned earlier in this thread). console.log(JSON.stringify(abi)); // AND NOT console.log(abi) And to copy&paste the resulting string copy&pasted to ...


0

This issue was totally my bad: Not visible in the sample I provided is some code that mints a small amount of tokens to the miner of the block. (Not sure why (it was a long time ago)). On the blockchain, this would have worked just fine, but I was testing locally using truffle's Ganache. Because Ganache is only a test blockchain, there are no miners, and ...


1

Depends on what is written/codded into the deployed contract. If there are functions that only the contract owner should be able to call (Like minting or burning tokens, or changing some limits), then this is a serious problem that can't be solved (You might manage to transfer ownership to another address before the other party does it. That might somewhat ...


1

The contracts use inheritance. So it goes something like A > B > C, where C inherits B and B inherits A. Assuming the A, B and C are non-abstract contracts, you can deploy any one of them. If you deploy A, the resulting contract has A's functionality. If you deploy B, it has functionalities from A and B. And C has functionalities from A, B and C. With ...


0

Since you want to use the blockchain to store the information, I recommend a contract factory pattern. So you should have one contract factory contract. That contract acts as a factory: it creates contracts upon demand. At the same time, it keeps track of who has deployed what contract. Whenever you need information about who has deployed what, you just ...


0

That's why the interface is needed. Block2 must be look like below: interface A{ function double(uint a)external returns (uint res); } } contract B{ uint res; A objOfA; function B(address _addressOfContractA){ objOfA = A(_addressOfContractA); } function call_double(uint val) { res = objOfA.double(val); } }


0

for me it works if I declare the msg.sender as a address variable at the start of my constructor contract Test is ERC20{ address public OWNER; uint private _totalSupply = 500000; constructor() ERC20("Test Token ERC20", "T20"){ OWNER = msg.sender; _mint(OWNER, _totalSupply); } }


0

Since solidity 0.8.x you can do import { contractA } from "contract/path/1"; import { contractB } from "contract/path/2"; This will prevent the shadow import of contractB if it is also used in contracA


0

Where are you trying to deploy the contract? you need the "Injected Web3" environment option to deploy to a non-local blockchain (i.e. one selected in your Metamask for example).


0

use contractFactory.getDeployTransaction, see doc sample code: const contract = new ethers.ContractFactory(...); const gasToUse = await ethers.provider.estimateGas(contract.getDeployTransaction(...))


0

The only way to solve it was for the Domain contract to be the one containing PayToSerial function.


0

You can "integrate both contracts" The way to solve this is to deploy them separately (as you seemed to have guesed). Just make sure that Factory contracts has a function named SetChildContractAddress(_address) SetChildContractAddress(_address){ CHILD =Child(_address); //Child variable needs to be declared prior } Once you have deployed both ...


3

You need to deploy compatible token contracts on both networks, ideally not ERC-20 but ERC-677, and then set up a two-way bridge on both networks. You should look into ChainSafe's Chain Bridge or POA Network's Token Bridge. I would recommend an AMB with an ERC-677-to-677 module. Make sure the bridge mode is set to AMB_ERC_TO_ERC: BRIDGE_MODE=AMB_ERC_TO_ERC ...


4

You don't need ABI to deploy a smart contract, it is usually used by the abstraction layer of libraries to create dynamic objects that help developers with further calls, but it is not used in the deployment phase. That said, you can copy and deploy an already deployed smart contract without any modification in 99% of the cases, but if there's peculiar ...


2

Interface and contract types in solidity are just compile time wrappers around an address. If you look at the generated abi filed for your code you will see that the parameter type expected is an address. And actually the generated bytecode will not perform any type checks on this address. If you want to check if a specific address implements an interface I ...


0

It is nearly impossible to do this easily without monitoring all transactions (and internal transactions). Since Etherscan is doing this, they can provide this information. When you monitor all transactions you will most likely find most of the contract creations (transactions without a to). But quite some contracts are created by using the create and ...


0

You can try this command; it worked for me and don't forget to fund your Ethereum accounts: truffle migrate --network=kovan --skip-dry-run


0

Use deployedContract = await ethers.getContractAt("ContractName", ContractAddress);


0

Of course you can. The ABI is not required to deploy any contract, you need it to verify it (not mandatory) and to interact with it in a simplified manner. For instance, you can deploy any ERC20 compliant contract to the blockchain, avoid to verify it, and still you will be able to interact with it using any ERC20 compliant call, generated whatsoever. Or, if ...


1

Not sure if there is 1 correct answer to this one. Personally I started using a singleton factory (there are different ones out there) for the Safe, because we wanted to enable everyone to deploy the contracts to the same address (e.g. on a local network). But this is not the only advantage. By using such a factory the contract address itself is proof the ...


0

You have to choose which one to compile & deploy. Or, you can of course compile everything and only choose the one to deploy. Or, if needed, you can deploy all of them. The used tooling also influences this. For example command-line utilities such as Hardhat and Truffle always compile everything (unless told otherwise). But for obvious reasons you always ...


0

Alternatively you can change the default network to the testnet you are deploying on. If I'm not mistaken brownie will launch and connect to ganache-cli by default. You can refer to the documentation here https://eth-brownie.readthedocs.io/en/stable/network-management.html#live-networks, or refer to the picture below


1

yes there are, dapp.tools and openzeppelin being the most battle tested and reused


0

None of these answers worked for me until I used the following, including the provider, the signer, and getting the contract instance: const provider = new ethers.providers.JsonRpcProvider() // using default http://localhost:8545 const signer = new ethers.Wallet(privkey, provider) const myContract = await ethers.getContractAt('MyContract', contractAddress, ...


0

You get the gas cost warning, because it is not possible to estimate failing transactions. To test why your transaction is reverting it is easiest to test against the remix integrated network, as they provide more information (e.g. revert message). In general you code will not work as donate send eth to receiver which is set to the contract itself in the ...


1

Yes :) Current gas price being 100 gwei for example.


Top 50 recent answers are included