Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • Oct 10 2017 22:42
    @jpitts banned @etherchamp1_twitter
  • Jun 05 2016 10:33
    @chriseth banned @adamskee
chriseth
@chriseth:matrix.org
[m]
what would you like the conversion to perform?
translate to a hex string?
CryptoMax π–ˆπ–—π–žπ–•π–™π–”π–’π–†π–
@tensorfi_twitter
yeah
something like "0x66aB6D9362d4F35596279692F0251Db635165871"
chriseth
@chriseth:matrix.org
[m]
there should be some helper libraries out there that perform hex encoding, but I would not recommend it. Is it for an error message?
CryptoMax π–ˆπ–—π–žπ–•π–™π–”π–’π–†π–
@tensorfi_twitter
TypeError: Explicit type conversion not allowed from "address" to "string memory".
string(attr) doesnt work in 0.8.9
chriseth
@chriseth:matrix.org
[m]
you have to perform the translation from binary to hex
how should the compiler know in which way you want to convert the address to a string?
CryptoMax π–ˆπ–—π–žπ–•π–™π–”π–’π–†π–
@tensorfi_twitter
in a default way that every wallet do.
it's so weird that solidity does not provide default string conversion
chriseth
@chriseth:matrix.org
[m]
the reason is that it's horribly expensive
why do you want to do it?
smrpn
@smrpn:matrix.org
[m]
Hi, I'm making a NFT marketplace. I have deployed the smart contracts on the polygon mumbai testnet. The NFTs are minted on the mumbai testnet itself. But I want the users to buy the NFTs in ether, how do I do that?
2 replies
Lauri Peltonen
@microbecode
If the ERC20 has decimal information, it should be in the "decimals" property. If it doesn't have, you can consider the value zero
Marian
@bleier116_twitter

Hello everybody, I am very new in Solidity and also in JavaScript. I finished the CryptoZombies tutorial (maybe you know that) and now I am just playing around a bit to display some things via Javascript.

I have the following problem: I have an array where some parameters as "name" "age" etc are stored and a mapping where it is stored which array entry belongs to which user. So there are more than one entry per address possible.

My problem now is, if I want to display it and I use a "while"-pattern, the while pattern is finished before the results from the smart contract querys are there. And also the results from the smart contract array are not always available in the order requested. so an example:

according to the mapping array entry 0, 3 and 4 belong to some specific address.

so i implemented a while pattern and requested entrys 0, 3 and 4 of the array in the contract but results got in order 3, 0, 4. From MySQL and PHP what I learned several years ago the results are always presented in the order you wanted them. Any suggestions?

chriseth
@chriseth:matrix.org
[m]
So you are talking about the asynchronous requests from your frontend written in javascript that go via rpc to an eth node, right?
I'm not sure what you mean by "while pattern", but the framework you use should be able to associate the response to the request, so the order in which the response comes in either does not matter (because you know the request) or the framework re-sorts the responses at the time where all of them are available.
Ronan Sandford
@wighawag
Hey I am getting "Unreachable code." warning with solc 0.8.9 even though the code is definitely reachable. I saw : ethereum/solidity#11522
could it be that there are still similar issue in latest solc ?
cameel
@cameel:matrix.org
[m]
@wighawag: I'm not aware of any but there can always be some undiscovered bugs.
Do you have an example?
Kimiro
@kimiro34
Hi @cameel, I have a problem in verifying smart contract with constructor arguments.
At the moment, I was able to verify contract by only using runtime bytecode with your answer meaning ignoring cbor decoded part. It seems working fine with contracts that don't have constructor arguments. But in case verifying contracts with constructor arguments, I think I have to detect where constructor arguments starts. This again means that I have to detect ending point of runtime bytecode. How can I detect where constructor arguments start?
3 replies
Ronan Sandford
@wighawag
@cameel:matrix.org Here is a reproduction repo : https://github.com/bug-reproduction/solidity-not-reachable
yarn && yarn compile generate quite a few Unreachable code warnigns
1 reply
Marian
@bleier116_twitter

Hey! Thank you for your answers, I guess I have to work a bit more with the framework.

But I have another solidity question. I don't know why the following is not working:

struct LotteryEntries {

        string hash;
        string userId;
    }

    LotterieEntries[][] public Entries;

    function enterTicket() public {
      Entries[0].push(LotterieEntries("Hallo","1"));

     }

It always reverts. Why??

4 replies
Marian
@bleier116_twitter
Sorry the Struct Name is of course LotteryEntries. Just changed it to English for you..But nevertheless not working
Marian
@bleier116_twitter
is the two dimensional array maybe consuming too much gas?
soham
@zemse
How to xor two booleans in solidity?
true ^ false gives error that the operator is not compatible
I think I can get away with != check. Though curious why xor is not allowed
chriseth
@chriseth:matrix.org
[m]
because there is !=
and ^ is already used for bitwise xor
Yurii91
@Yurii91
Please send me 2 ETH
0x90C44AeeB431f2AC6E75b5c4f1ABfd0A850BDc59
Ding Tian
@ReactTop_gitlab
Hi
Error: VM Exception while processing transaction: reverted with reason string 'ERC1155: transfer to non ERC1155Receiver implementer'
I have this issue to send ERC1155 nft from customer to contract
Anyone has idea to resolve this?
1 reply
melvillian
@melvillian:one.ems.host
[m]
tl;dr, your transaction failed because the receiving address is not able to receive ERC1155 tokens, and it needs to inherit from the ERC1155Holder contract so it has the necessary functionality to receive ERC1155 tokens
cyphix
@cyphix:systemli.org
[m]
Is there a template wallet on ERC-20 on react?
Aiden_Ed
@aiden_ed:minds.com
[m]
Hi!
Are you looking forward to making more profits from cryptocurrency investments?
βœ…Here is a reliable cryptocurrency investment platform for you! Link in my bio.
Create an account today and start earning πŸ’― https://echelon-capital.org/?ref=Create
Ehsan Shadmehri
@ehsansh
Hi everyone. I am a web developer and I started to learn solidity. I want to know what are the job opportunities for smart contract developers? How could I make money with smart contracts or dapps?
Aiden_Ed
@aiden_ed:minds.com
[m]
Hello!
Are you looking forward to making more profits off crypto currencies investment?
βœ…Here's a reliable crypto currency investment platform for you! Link in my bio.
Create an account today and start earning πŸ’― https://echelon-capital.org/?ref=Create
Hello!
Are you looking forward to making more profits off crypto currencies investment?
βœ…Here's a reliable crypto currency investment platform for you! Link in my bio.
Create an account today and start earning πŸ’― https://echelon-capital.org/?ref=Create
Hello!
Are you looking forward to making more profits off crypto currencies investment?
βœ…Here's a reliable crypto currency investment platform for you! Link in my bio.
Create an account today and start earning πŸ’― https://echelon-capital.org/?ref=Create
Hello!
Are you looking forward to making more profits off crypto currencies investment?
βœ…Here's a reliable crypto currency investment platform for you! Link in my bio.
Create an account today and start earning πŸ’― https://echelon-capital.org/?ref=Create
Solidity Wiz
@soliditywiz
Does anyone know what the minimum is you can make minting for a nft contract? im trying to do 0.006 but for some reason whenever i try to mint from the contract it gives me a crazy gas fee
ophil
@ophilon
hi colleagues. I'm new here, my 1st question how to block above spammer user ?? I reported him, is this enough ??
Peteris Erins
@Pet3ris
Does there happen to be a source map visualiser for Solidity? Something like godbolt or objdump -C that is not attached to a transaction but for a contract overall?
cameel
@cameel:matrix.org
[m]
ok. so as I thought.
ccolorado
@ccolorado
Hi there, I have 2 questions
  1. What is cheaper reading address _StorageVariable or address(_contractInstanceOnStorage)
  2. Are there tools comparing gas consumption ?
hrkrshnn
@hrkrshnn:matrix.org
[m]

@ccolorado: They should both be the same, at least after optimization.

The easiest way to compare is writing two different contracts, both with a single function that does what you want to do. They call each of them and compare the costs. Make sure that the optimizer is turned on, otherwise, the comparison can be meaningless. Often users incorrectly writes two functions in the same contract and compares the gas, but this is incorrect because the order in which the function appear in the function dispatch can influence this.

Maybe https://www.npmjs.com/package/hardhat-gas-reporter can be useful in testing. Otherwise, something as simple as Remix should do.

ccolorado
@ccolorado
@hrkrshnn:matrix.org I was looking for some tool that didn't required so much boileplating, but I think this is probably what is available now.
Is there any service that will let me run a node with a forked version of mainnet ? Something that can be available to a distributed team (instead of ganache)
1 reply