The Solidity Contract-Oriented Programming Language - By chatting here you agree to the https://github.com/ethereum/solidity/blob/develop/CODE_OF_CONDUCT.md
@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 {
@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.
https://docs.soliditylang.org/en/latest/contracts.html?highlight=interface#interfaces
// 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;
else
return false);
}
}
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);
39.17067306879699
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?....
stopAfter: "parsing",
.yul
files because they do not have all the semantic information the compiler needs at the Solidity level.
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?