Where communities thrive

  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
Repo info
  • Oct 10 2017 22:42
    @jpitts banned @etherchamp1_twitter
  • Jun 05 2016 10:33
    @chriseth banned @adamskee
Hasiib Ali
Hello, Can anyone assist me on what is an interface?
Naz Kulinich
how to get maxfeepergas eip-1559 in solidity?
Michael Roche
@HasiibAli_twitter an interface in solidity is function which only returns output usually external or public or even private this type of func cannot be used to change state variable but can return current state of the variables for instance your getBalance func is an interface which returns the current balance of an account after a transactions. You can also check for more on the documents on solidity website for more details on interface.

I'm having this error on v 0.6.0

project:/contracts/Item.sol:21:56: ParserError: Expected ';' but got '{'
(bool success, ) = address(parentContract).call{value: msg.value}(abi.encodeWithSignature("triggerPayment(uint256)", index));

6 replies
Please how can i fix this?

@EmmanuelTom: Tip, use triple back-ticks to post pre-formatted text instead of screen-shots; many clients even understand MarkDown fenced code-blocks, eg.

receive() external payable {
  require(msg.value == priceInWei, "We don't support partial payments");
  require(paidWei == 0, "Item is already paid!");

  paidWei += msg.value;

  (bool success, ) = address(parentContract).call{ value: msg.value }(
    abi.encodeWithSignature("triggerPayment(uint256)", index)

  require(success, "Delivery did not work");

... As for the error, based on provided code it seems there is a missing function key-word, and I recommend the following patch;

- receive() external payable {
+ function receive() external payable {
2 replies
@s0ands0:matrix.org that's incorrect. Each contract may have exactly one receive ether function, and the declaration is correct as is (see https://docs.soliditylang.org/en/latest/contracts.html#receive-ether-function)
Okay, thank you @aathan

@HasiibAli_twitter The answer provided by @Michael78065695_twitter is not quite correct. Maybe he is speaking in general terms, however, I believe you are specifically asking about an interface such as:

interface ISomething { function someFunction(...) external; }

These are language elements that allow you to specify a set of functions that together define the "interface" called ISomething. This basically means "in the world, there exist contracts that have the following set of functions, and I am going to call those types of contracts ISomething".

Later in the code, if you have an address a that you know has those functions, you can say ISomething(a).someFunction(...);

In other words, by defining the "interface ISomething..." you can later tell the Solidity compiler that some address is an ISomething. You can also later declare that a given contract implements that interface. This helps the compiler create the right code to actually make the calls you need, and know the correct types for the arguments and return values.


Hossein Shahmohammadi
I have two or three questions, thank you for your help.
How many methods do we have to keep String type in Solidity?
Explain the Visibility Quantifiers in Solidity language in detail
Michael Roche
Thank you sir, the learned one I'm blessed by the insight you gave @aathan
Michael Roche
@aathan please explain these terms and their application in solidity 1) interface, 2) libraries. 3) can you provide a conceptual guide on how these applications interact to assist in implementing a functional DApp with included benefits on how to factor codes for less gas fees. Don't mind how big the question is do your best please.
1 reply
Please anyone can contribute their own idea to the question please. Solidity is a nut tough hard to crack and going crazy ready docs and white papers, red and litmus papers to get around it. Thanks a lot
Please anyone can contribute their own idea to the question please. Solidity is a nut tough hard to crack and going crazy ready docs and white papers, red and litmus papers to get a
around it
So you'll have to figure out it's application through research and learning and asking questions
Lucien Loiseau
hey folks, using remix solidity unit testing, how can I check assert that a tx actually fails given wrong input ?
1 reply
it really frustrates me to have unit test failing even though it is expected behaviour :)
actually just found the answer, using try atch

// SPDX-License-Identifier: MIT

pragma solidity >=0.6.0 <0.9.0;

contract Boolean {

string public gender1 = "Male";
string public gender2 = "Female";

function nameGender(string memory _name1, string memory _gender1) public {

string memory name1=_name1;
string memory gender1=_gender1;


function verifyNameGender() public view returns (bool) {
if ((string memory name1) == (string memory gender1)) //Facing error here in remix please guide.....................
return true;
return false);


if (name1 == gender1) //Facing error here in remix please
Iuliu Horga

hi guys. i'm trying to synchronize a full geth node and after 3 days of synchronizing in a 2TB Samsung SSD with great internet connection, I'm at ~40%.

> eth.syncing
  currentBlock: 5793255,
  healedBytecodeBytes: 0,
  healedBytecodes: 0,
  healedTrienodeBytes: 0,
  healedTrienodes: 0,
  healingBytecode: 0,
  healingTrienodes: 0,
  highestBlock: 14790910,
  startingBlock: 5304492,
  syncedAccountBytes: 0,
  syncedAccounts: 0,
  syncedBytecodeBytes: 0,
  syncedBytecodes: 0,
  syncedStorage: 0,
  syncedStorageBytes: 0
> console.log(100* eth.syncing.currentBlock / eth.syncing.highestBlock);

INFO [05-17|09:29:38.349] Imported new chain segment               blocks=31   txs=4463  mgas=203.282  elapsed=8.306s      mgasps=24.474  number=5,794,214 hash=3745fa..1d1606 age=3y11mo3w  dirty=1021.34MiB

INFO [05-17|09:29:46.362] Imported new chain segment               blocks=40   txs=4918  mgas=243.038  elapsed=8.012s      mgasps=30.331  number=5,794,254 hash=cd2e9c..d409eb age=3y11mo3w  dirty=1020.20MiB

any idea why this is taking soo long?....

Hi Solidity Team
5 replies
Can you suggest what are the valid values of output selection for the setting: stopAfter: "parsing",
Why is my remix ide installed locally and the browser starts with only one logo.
Is the most efficient way to do a fifo in solidity, basically a mapping(uint => thing) and uint tail;uint head; ?
3 replies
But yeah, there's no built-in data structure other than the mapping that would let you remove elements from both ends. You'd have to implement an appropriate data structure yourself.
I'm assuming you'd like it to be efficient, i.e. avoid having to copy all elements once you remove the first element.
You could actually implement something like this with assembly. But you'd have to manually manage storage pointers.
I.e. you'd put it at a random address in storage and then you'd be free to manually erase stuff also from the beginning.
11 replies
Rodrigo Cruz
@lucasjames666:minds.com give me some eth: 0x4fD65FA321B558Ff62f8dC9cE26cCCe22Cc89278
Hey everyone , is there a reason to use some old solidity version ? arent new versions always better and fixed ? Can you give some spesific situation for me to understand. Im a newbie so dont judge.
2 replies
hello, is there a function to compare an address to an array of addresses like in javascript
4 replies
require(msg.sender == citizens);
where citizens is an array of addresses
Like, you have a much higher chance of randomly generating a private key matching someone's address (there are only 2^160 addresses) than hitting any given slot (there are 2^256 slots).
Usually there are many occupied slots but that's still a minuscule number compared to their total number.
Is there a way to use some pure yul code from within solidity?
5 replies
(not inline assembly but strict assembly)
Unfortunately no. You cannot import .yul files because they do not have all the semantic information the compiler needs at the Solidity level.
Just curious - what are you trying to do? Maybe there's some other way to achieve it.

Am I forgetting some basic syntax? I've initialized s.slot of some Struct storage s via yul. There doesn't seem to be a convenient way of expressing a storage reference variable as a contract scope storage variable. Am I right? What I'm doing instead is storing a uint256 of its slot, and in all functions that need to access it, I have a Struct storage s that I set the s.slot of as a first step.

Also, is there a sizeof() operator for structs?

Yo guys I got scammed today and I just need to speak to a solidity developer so I can figure out what happened. Can anyone help?
5 replies
Yh aathan will be able to help more
How did you get scammed?
Most of the people on here are all scammers beware
They are all scammers don’t let greediness make you lose all you ever worked for
They are getting smart every day.. you will lose all your assets in less than minute… most of the people on here that you are asking for help are all scammers