Questions tagged [solidity-0.8.x]

345 questions
2
votes
1 answer

Is the "transfer" call in Solidity asynchronous?

I'm asking myself if the call to a function like transfer in solidity is asynchronous. In other words, I'm working with the following contract function count_and_pay() public { if (lockCon == true) return; if (positiveVote >…
macros
  • 23
  • 3
1
vote
1 answer

Web3ContractError: The number of arguments is not matching the methods required number. You need to pass 0 arguments

The below is my inbox.test.js file code: const assert = require('assert'); const ganache = require('ganache-cli'); const {Web3} = require('web3'); const web3 = new Web3(ganache.provider()); const {abi, bytecode} = require('../compile'); let…
Swetha N
  • 15
  • 4
1
vote
1 answer

How to do safemath with solidity 0.8.0

Will (a+b) work and be safe in solidity 0.8.0? Or do I have to do something like a.add(b)?
Ron Antes
  • 11
  • 1
1
vote
0 answers

Error: Copying of type struct QueueTesting.seller memory[] memory to storage not yet supported

I am trying to implement a queue in solidity using arrays. But I keep getting this error. Is there any other way to store array of type struct from memory to storage? //SPDX-License-Identifier: UNLICENSED pragma solidity ^0.8.10; contract…
Divyya
  • 31
  • 3
1
vote
1 answer

Declaration error identifier not found or not unique , can someone help

pragma solidity ^0.8.4; import '@openzeppelin/contracts/token/ERC721/IERC721.sol'; import '@openzeppelin/contracts/access/Ownable.sol'; contract NewMintContract is ERC721, Ownable { uint256 public mintprice = 0.03 ether; uint256 public…
Learner
  • 11
  • 1
1
vote
1 answer

Avoid Duplicate Addresses in Array

address[] public players; mapping(address => bool) private activePlayers; I want to avoid duplicate players to enter in players array, so i want to understand if i create a such mapping with address pointing to bool. and once the game is over can i…
1
vote
0 answers

Version 8 Solidity: Difference between call with {…} (abi.encodeWithSignature(…), value) and call (abi.encodeWithSignature(…), value)

I have got following SC: // SPDX-License-Identifier: GPL-3.0 pragma solidity ^0.8.7; //https://www.zupzup.org/smart-contract-interaction/ import "contracts/CalleeVer8.sol"; contract Caller { function someAction(address addr) public returns(uint)…
zak100
  • 1,406
  • 1
  • 13
  • 37
1
vote
0 answers

Solidity version 8:Two errors with Call _ unary operator Not allowed_not convertible to bool, what is the minimum gas value for call?

I am getting two errors with call: My contract is: //SPDX-License-Identifier: UNLICENSED pragma solidity ^0.8.10; contract TestingFF { uint cP = 100; address payable k; receive() external payable{ } fallback() external payable { …
zak100
  • 1,406
  • 1
  • 13
  • 37
1
vote
1 answer

Solidity 0.8.x test today's date from block.timestamp

I want to make sure that the block.timestap that keep on running is represent today's date. I can get from this code but not really sure is this the right way. function isTodayDate() view public returns(bool) { uint _block =…
0
votes
0 answers

Error in smart contract

// SPDX-License-Identifier: MIT pragma solidity >=0.4.22 <0.9.0; contract SupplyChain { //Smart Contract owner will be the person who deploys the contract only he can authorize various roles like retailer, Manufacturer,etc address public…
0
votes
0 answers

Error in smart contract

// SPDX-License-Identifier: MIT pragma solidity >=0.4.22 <0.9.0; contract SupplyChain { //Smart Contract owner will be the person who deploys the contract only he can authorize various roles like retailer, Manufacturer,etc address public…
0
votes
2 answers

DeclarationError: Undeclared identifier. (in solidity verify signature)

I'm new to computure program. What does this problem mean in solidity? How can I solve this problem? Here is the problem: DeclarationError: Undeclared identifier. "getMessageHash" is not (or not yet) visible at this point. -->…
0
votes
0 answers

Why is my solidity compiler not generating bytecodes?

For some reason the my solidity compiler did not include many fields in the contract.json file. Most importantly I miss the data field. The first field I get is abi. Here is my contract: pragma solidity 0.8.9; import…
samuelnihoul
  • 163
  • 6
0
votes
1 answer

Returned error: VM Exception while processing transaction: revert when multiplying

I geting VM exception calling this function. Someone could give me a hint? function ownerCheckReward(address _address) view external returns(uint){ uint _moment = moment[_address]; uint _allowance = allowance[_address]; uint _timestamp =…
Rodrigo Burgos
  • 764
  • 3
  • 15
0
votes
1 answer

version 8.0 SC: ParserError: Expected '(' but got ')'

Following is my SC: //SPDX-License-Identifier: UNLICENSED pragma solidity ^0.8.10; contract DS{ address payable cer; address public owner; constructor() public { owner = msg.sender; cer = (payable) msg.sender; } } The…
zak100
  • 1,406
  • 1
  • 13
  • 37
1
2