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
Danny Pr.
@dannpr

Hi I'm actually doing an online course and I'm developping on nextjs but I have this poblem on my web3.js code :Server Error
ReferenceError: window is not defined

This error happened while generating the page. Any console logs will be displayed in the terminal window.
Source
eth/web3.js (3:0) @ eval

1 | import Web3 from "web3";
2 |

3 | window.ethereum.request({ method: "eth_requestAccounts" });
4 |
5 | const web3 = new Web3(window.ethereum);
6 |

ETHERUEMconsultant2018
@ETHERUEMconsultant2018
we are so sorry to hear about your situation you can contact eth@consultant.com for any issu
Luis Schliesske
@gitpusha

Hi @cameel:matrix.org I read in the docs:

block.basefee (uint): current block’s base fee (EIP-3198 and EIP-1559)

https://docs.soliditylang.org/en/v0.8.9/cheatsheet.html?highlight=block.basefee

It's a bit ambiguous as to whether this is the base fee of the previous block or the current block that this transaction will be included in.

Is it the basefee of the block that the transaction is included in?

1 reply

Also I wondered what's the best way to get the value for the transactions priorityFee?

Is it: tx.gasprice - block.basefee ?

1 reply
S0AndS0
@s0ands0:matrix.org
[m]
@dannpr: Are ya importing web3.js within a browser or server context?
anyi
@AnYi-ray
Hi, everyone.
I don't know if I can ask such a question here. I apologize first.
I am learning about Ethereum development. I'm interested in instant messaging based on Ethereum or other blockchain platforms, but I don't know much because I'm a novice. If I want to develop an end-to-end instant messaging based on blockchain, what technologies should I learn? Or is there a project recommendation?
My English is very poor, so the above comes from the translator. If there are sentences that are not smooth, I'm so sorry!!!
3 replies
贝克街的天才
@yuyenews
First learn solidity, ethereum programs are all smart contracts. As for the instant messaging you mentioned, it should be a new way of playing smart contracts, just check it out when the time comes.
1 reply
cyphix
@cyphix:systemli.org
[m]
Ethereum Wallet with ERC20 support (GitHub). A simple interface that allows users to transfer tokens after selecting which ERC 20 token they would like to send?
Ding Tian
@ReactTop_gitlab
Hi everyone . is there any contract code to accept BUSD ?
Nuzzep
@nuzzep_twitter
Hello guys, i'm trying to understand the source code of reflect.sol
anyone has an useful documentation or guide or tutorial? thanks
cyphix
@cyphix:systemli.org
[m]
@nuzzep_twitter: Not answer questions here
bunch of questions and not one answer
Dumb canal
dg
@dan-garay
is there a gas efficient way to reset a uint256 -> uint256 mapping?
1 reply
Giorgi
@novaknole:matrix.org
[m]

Hi all...

I am trying to get my head around ERC223

Thank you in advance
Luis Schliesske
@gitpusha
thx for the help @hrkrshnn:matrix.org
CyberProduct
@CyberProduct
Hi everyone. I'm manager and know nothing about smart contracts. Developer in my team is looking for examples of complex or not standart smart contracts for Ethereum (Solidity) or Tron. If you know some examples I will be very glad to recive link.
CryptoMax 𝖈𝖗𝖞𝖕𝖙𝖔𝖒𝖆𝖝
@tensorfi_twitter
Hi is there a efficient way to convert address to string memory?
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