New answers tagged

0

Your contract needs to allow the transaction sender to spend CHI tokens belonging to the contract. To do this, the contract has to call approve method of the CHI token contract, which can be problematic because you'd have to code a method that does that. Thus, it's better to use freeUpTo which spends msg.sender's tokens. Proof: function freeFromUpTo(address ...


1

The factory contract - PancakeFactory - is here: https://bscscan.com/address/0xcA143Ce32Fe78f1f7019d7d551a6402fC5350c73 If you read the contract, you'll see that allPairsLength gives you 14,690 pairs. This refers to the number of PancakePair-type contracts. The addresses can be found by reading the allPairs array in PancakeFactory by specifying the index you ...


1

You can use https://bscscan.com/ for Binance Contracts. You can use https://etherscan.io/ for Ethereum Contracts. Here pancakeswap: https://bscscan.com/token/0x0e09fabb73bd3ade0a17ecc321fd13a19e81ce82


0

turns out it was just me being stupid! I was trying to run the transaction with an outrageously low amount of ether (4 gwei) which is, of course, so small that it can't be seen in the Ganache app. The reason I was seeing no new coins being created was because my conversion code rounded the result to 0.


1

I guess you thought the below lines define a contract; var customer=new web3.eth.Contract(customerJs.abi, null, {data: ByteCode}); web3.eth.personal.unlockAccount("0x83Ad536099658519ee6A40A3faCAf3dDcEf6178a","Alireza").then(()=>{console.log("Address unlocked");}).catch(console.error); customer.deploy().send({...


0

You are missing the fallback function. Solidity 0.5 the fallback function was a function without a name. contract Test { event Payment(address sender, uint amount) // Fallback function solc v0.5 style function() external payable { emit Payment(msg.sender, msg.value); } }


0

The user pays gas for (C) F -> (C1) F1 -> (C2) F2 -> ... Those execute in the context of a single atomic transaction. It might help to consider that it is usually not possible to run F without knowing what F1 returned. Generally, if F2 fails, then the error will bubble up to C and transaction T. If T reverts then they all revert. It will turn up as ...


1

The hex data in the question is data field that goes to the Ethereun smart contract.: transfertoken(address, index) 4 bytes for hash transfertoken(address,index) string - choosing which smart contract function is called 256 bits (32 bytes) for address 256 biys (32 bytes) for index You can use ABI encoding and decoding facilities of Web3.js to create the ...


0

As others have mentioned, the web3 libraries are built on the Ethereum JSON API through which you can send requests using any simple networking library, of which I'm sure there are plenty of in whichever language you seek to make it work with. (Taken from this article which also has more information on implementation)


0

Aleth is/was the official C++ Ethereum implementation, though it hasn't been updated in 18 months, and generally the Go implementation (Geth) is pushed as the de facto official implementation now. The associated C++ Web3 library - libweb3jsonrpc - can be found in this Aleth repo.


0

EVM is essentially a stack machine, you can use Ethereum WebAssembly - EWASM, currently, it is in the development phase. From this Article: Ewasm will support more languages and will benefit from a more extensive set of tools than the EVM.⁹ Some prominent examples of additional languages supported by Ewasm include, C, C++ and Rust.⁷ Ewasm will also enjoy ...


1

First of all, ERC721 has its amount fixed as 1, so you might wanna use ERC1155. If you want to create 1500K ERC721 or 1500 ERC1155(1K of each) collectibles, I would not suggest you create all of them in one go, as there is a high possibility that they will exceed the block gas limit. From your question, I see that you have all the different token URIs stored ...


0

I was having a deep dive through an address I found interesting and noticed that all his tokens always came from a contracts 0x0 address. How is this done? There is no standard for this. However minting and burn events generally use the address 0x0 as the source and destination to identify new tokens were created or the token supply was reduced. This is ...


1

Ran into the same problem. Looking at the code, there seems to be a hardcoded timeout to 5 seconds.


0

After a few hours of research, I found out that they slightly renamed it to AaveProtocolDataProvider and moved it into new path: @aave/protocol-v2/contracts/misc/AaveProtocolDataProvider.sol Besides that, the balance of any aToken can be acquired directly by calling its balanceOf method.


1

As previously stated from the other answers, they use CREATE2. That happens because when you receive ERC-20 or any other token on a unique address, from a business perspective, it is very operationally costly, as they would need to top up these accounts with funds to be able to pay the GAS fees to sweep the tokens out to a centralised cold wallet. With the ...


Top 50 recent answers are included