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]
We fixed some issues with the reachability analysis in 0.8.5 - maybe we got something wrong.
do you use inheritance? the new code considers all functions relative to all contracts, so maybe marking unused contracts as abstract could help
can you create an issue on the solidity repo together with example code?
Lukas Hönig
@lhoenig_gitlab
@chriseth:matrix.org will create an issue!
chriseth
@chriseth:matrix.org
[m]
I don't think it's an issue with the assembly. do you have functions that always revert?
Lukas Hönig
@lhoenig_gitlab

Not that I'm aware of.. we are using a pretty standard contract with this signature:

contract Wayback is usingProvable {

the other file is this one https://github.com/provable-things/ethereum-api/blob/master/provableAPI_0.6.sol with some minor patches for 0.8.x compatibility..

Lukas Hönig
@lhoenig_gitlab
I'll try to come up with a minimal example that triggers the warnings.
Lukas Hönig
@lhoenig_gitlab
@chriseth:matrix.org You're right, it doesn't have to do with the assembly. I was able to isolate the issue to the usage of library Buffer in the above mentioned file. Any function that uses Buffer AND calls any function on it is understood by solc to never return. Further than that, I'm not sure what in Buffer is causing this.
B.M
@bigman1208000
@Morteza3123
transfer() does that, but it could require a series of prerequisites depending on the context. like approve(), or even allow someone else (like an exchange) to swap on the individuals behalf with transferfrom()
ExeciN
@ExeciN:matrix.org
[m]
I'm trying to wrap my head around 2 dimensional arrays but the syntax gets in the way. Will (arr[i])[j] work? will it be different than arr[i][j]?
ExeciN
@ExeciN:matrix.org
[m]
I declared my array like this someStruct[][256] public arr; so when I do arr[i].push(x) I don't know if i refers to the static or to the dynamic part
I guess I could try something like arr[300].push(x) and see if I'm out of bounds
chriseth
@chriseth:matrix.org
[m]
just think of it as an array of arrays
when you access an element you can use parentheses
you can even assing "one dimension" to a local variable
when you declare the type then you cannot use parentheses (I think)
Lukas Hönig
@lhoenig_gitlab
@chriseth:matrix.org ethereum/solidity#11522
chriseth
@chriseth:matrix.org
[m]
thanks for reducing the example!
Lukas Hönig
@lhoenig_gitlab
No problem! :)
B.M
@bigman1208000
hello, guys sorry for interrupting but I need your help.
I'm trying to test my example Solidity contract using hardhat and I'm getting the following error:
TypeError: Cannot read property 'param' of undefined
Lukas Hönig
@lhoenig_gitlab
@bigman1208000 That looks more like a JS error than something with Solidity..
B.M
@bigman1208000
@lhoenig_gitlab Thanks for your support
Pi
@p-i-
Can anyone point me towards a good resource for learning Solidity?
DingTian
@ReactTop

contract SendEther {
function sendViaTransfer(address payable _to) public payable {
// This function is no longer recommended for sending Ether.
_to.transfer(1 ether);
}

function sendViaSend(address payable _to) public payable {
    // Send returns a boolean value indicating success or failure.
    // This function is not recommended for sending Ether.
    bool sent = _to.send(msg.value);
    require(sent, "Failed to send Ether");
}

function sendViaCall(address payable _to) public payable {
    // Call returns a boolean value indicating success or failure.
    // This is the current recommended method to use.
    (bool sent, bytes memory data) = _to.call{value: 1 ether}("");
    data = "hello";
    require(sent, "Failed to send Ether");

}

}

Hi everyone. functionalities of contract is not working to send ether now .

transact to SendEther.sendViaCall errored: VM error: revert.

revert
The transaction has been reverted to the initial state.

This is issue.
Anyone has idea ?
melbourne2991
@melbourne2991
Does anyone here have any experience deploying ERC1155 Factory contracts to opensea?
mongolsteppe
@mongolsteppe
Hi, I am writing some tests for my contract and one of its functions has a require such as this:
require(amount > 0, "Your current balance is 0");
Is there any way to verify with a test function that I'm getting the 'Your current balance is 0' exception? My intention is to have a test that passes if the wrong address calls the function and that require fails. Thanks!
Lukas Hönig
@lhoenig
@mongolsteppe try Hardhat in combination with waffle and ethers.io for testing. It‘s amazing. We do unit as well as integration tests with no problems.
mongolsteppe
@mongolsteppe
@lhoenig Will do, thanks!
phalexo
@phalexo
Hi, I am writing some tests for my contract and one of its functions has a require such as this:
require(amount > 0, "Your current balance is 0");
Is there any way to verify with a test function that I'm getting the 'Your current balance is 0' exception? My intention is to have a test that passes if the wrong address calls the function and that require fails. Thanks!
try {
// your code
assert.fail("Your current balance is 0");
}
catch error {
// code to handle error
}
//Something like this in Truffle
DiMeneses
@DiMeneses
anybody else find solidity's keyword choices kinda weird? For example "memory" vs "storage", or using "is" in inheritance, placing "public" between variable type and name
basically I'd like to understand more about these design decisions, but can't find discussion about it anywhere
1 reply
swkim109
@swkim109
John Doe
@peculiarity
Hello Everyone!
I have a method that accepts calldata myMethod(address callee, bytes calldata) and the body of the function is :
callee.call(calldata);
I have compile error with Expected primary expression. Any hints what this might mean?
John Doe
@peculiarity
Ok, calldata is actually a ketword :D. Fixed it. Please discard the request for help
cameel
@cameel:matrix.org
[m]

DiMeneses (DiMeneses):

anybody else find solidity's keyword choices kinda weird?

I don't think it's any weirder in that regard than any other of the popular languages. Programming languages are pretty diverse in terms of syntax.
There are quite a few very popular curly-braced ones (C, C++, C#, Java, JavaScript, Objective C) which might make it seem like certain things are always done in a certain way but even among these there's a lot of differences.

For example "memory" vs "storage",

What are the other keywords you would use here? Most languages do not even have to deal with such a distinction.
This is pretty specific to EVM and that's what the different addressing spaces available to a contract are called there so the keywords are pretty straightforward.

or using "is" in inheritance,

There's no standard. Some languages use a keyword, some don't.
Some of them use extends (Java, JS), some inherit, some Inherits, etc. Perl 6 for example uses is too. All of these keywords are common terms used when talking about inheritance.
Here's a comparison of the class syntax in many languages:
https://en.wikipedia.org/wiki/Comparison_of_programming_languages_(object-oriented_programming)#Class_declaration

placing "public" between variable type and name

Not any weirder than placing const or volatile between type and name in C++.
Or putting type after the variable name in Rust, Python, Pascal and others.
There aren't that many sensible many places to put these but you can be sure that if one is possible, there's a language somewhere that uses it :)

basically I'd like to understand more about these design decisions, but can't find discussion about it anywhere

I think that's a great question for the forum (https://forum.soliditylang.org). The chat is good if you have a problem and need an immediate feedback but things get buried quickly under newer messages.
For a deeper discussion about language design like this one the forum is probably a much better place.

Ozan Başkaya
@oznbskya
Any mentor can help me about learning path to ethereum development? I want to change my career path and need some advice
Asifalishaikh
@Asifalishaikh
One of my client asking for
Create BEP20 wrapped version of ERC20 tokens
Pleae suggest to meet this target
3 replies
Erik (Weijie) Gao
@balla121
hello
trying to work on some solidity this year
currently reading oreily and doing solidity zombies
let me know of any good resources
mongolsteppe
@mongolsteppe

@balla121 @oznbskya I think the best place to start is the official docs soliditylang.org/en/latest/introduction-to-smart-contracts.html
once you are confident in understanding the code samples there, then try to play around with https://ethernaut.openzeppelin.com where you will have to understand deeper concepts to get through some of the challenges

Once you have gone through the two links above, try to create a smart contract prototype with simple functionality (you can get pretty far just playing around with remix.ethereum.org/). Then go through web3js docs, truffle/hardhat... Best way to learn is through a practical example of developing a prototype and then upon need start learning new things here in there (e.g. I need unit tests, how do I do that? I need a local dev blockchain, how do I do that? etc)