Questions tagged [solidity]

Solidity is a language for smart contracts for blockchain technologies like Ethereum. It is designed to compile code for the Ethereum Virtual Machine. Use this tag for questions about programming smart contracts using the Solidity language.

Solidity is an object-oriented language whose syntax is similar to that of ECMAScript, but with static typing, and it is designed to compile to code for the Ethereum Virtual Machine for use in smart contracts in blockchain technologies.

6642 questions
1
vote
1 answer

I am getting invalid type ( struct ) error while interacting with the solidity smart contract

Here is the Error Message: Uncaught (in promise) Error: invalid type (argument="type", value="Proof", code=INVALID_ARGUMENT, version=abi/5.7.0) Here is the solidity function function createOffer( address _requestorAddress, address[]…
1
vote
1 answer

How to get the hash from a transaction with web3

I am trying to do a Dapp with Nodejs and truffle. I have a solidity contract that works fine and I would like to use the method getTransactionReceipt() from the web3 library to print in console the result, but I dont know how. The thing is that I…
P00
  • 11
  • 4
1
vote
1 answer

Transaction failed with execution error while call Function

I am receiving the following message: "Warning! Error encountered during contract execution [execution reverted]" What I'm trying to do is simple, I have a contract, where I don't get token, I just use ethereum and users just pay gas fee to…
THIAGO DE BONIS
  • 760
  • 7
  • 22
1
vote
1 answer

ERC4907 compile issue in "function _beforeTokenTransfer"

I am working on an NFT Marketplace creation task with Truffle. For that, I am using an ERC4907 smart contract and trying to compile it. Following is my ERC4907 code. // SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import…
1
vote
1 answer

Invalid implicit conversion from address payable to bytes memory requested. This function requires a single bytes argument

function setBasicDetails(string memory _registrationNo, string memory _farmerName, string memory _farmAddress, string memory _exporterName, …
1
vote
1 answer

facing an undefined error while using ethers.utils.parseEther("1") in testing

let fundMe let mockV3Aggregator let deployer const sendValue = ethers.utils.parseEther("1") beforeEach(async () => { // const accounts = await ethers.getSigners() // deployer = accounts[0] deployer = (await…
1
vote
1 answer

TypeError: Member "encodeCall" not found or not visible after argument-dependent lookup in abi

function encodeCall(address _newOwner, uint _sigRequired) external view returns (bytes memory) { // Typo and type errors will not compile return abi.encodeCall(this._addSigner, (_newOwner, _sigRequired)); } pragma solidity >=0.8.0…
1
vote
1 answer

Getting a random number with Chainlink VRF

I'm trying to generate a random number with Chainlink VRF for a raffle system. This number should have a maximum value of ticketOwners.length and a minimum of 0, as I'll be getting the index of the array to pick as winner. I currently have this…
1
vote
2 answers

Bypassing Solidity's assembly return blocking further function execution

Say I have contract Bar { function blockingFunction() public pure returns (bool) { assembly { return(0,0x20) } } } contract Foo is Bar { function foo() public pure returns(bool) { bool result =…
kuco 23
  • 786
  • 5
  • 18
1
vote
1 answer

Is there a way to change the picture after CID is created in Pinata?

everyone!! Can i change the picture after minitng at Opensea? Upload the image and json file to pinata. And after minting on Opensea, can I change the image on pinata? I want to change the image in Pinata so that it can be applied in Opensea. I…
katamela
  • 21
  • 4
1
vote
1 answer

Native coin MATIC has a Contract Address on the Polygon Network?

I am currently developing a donation smart contract for the Polygon blockchain. The donation contract should receive many types of coins like (MATIC, USDT, USDC, etc.). I first made the donate function like the below: function donate(address donor,…
azvast
  • 337
  • 4
  • 10
1
vote
0 answers

Explicitly calling named functions inside solidity proxy contracts

I am referencing the the Gnosis-safe proxy function here https://github.com/safe-global/safe-contracts/blob/main/contracts/proxies/SafeProxy.sol: // SPDX-License-Identifier: LGPL-3.0-only pragma solidity >=0.7.0 <0.9.0; /// @title IProxy - Helper…
xiaolingxiao
  • 4,793
  • 5
  • 41
  • 88
1
vote
2 answers

How to get the address of a contract deployed by another contract

-----START EDIT----- I don't know what I was doing wrong before, but the code below was somehow not working for me, and now is working, and it's exactly the same. I don't know how or what I was missing before, but both this minimal example and the…
Scott
  • 1,207
  • 2
  • 15
  • 38
1
vote
0 answers

How to set the cut as 2.5 %

I want to change the cut in the following code to 2.5%, how can I achieve this? unit256 public cutNumerator = 0; uint256 public cutDenominator = 100; uint256 cut = (msg.value * cutNumerator) / (cutDenominator); I thought it could be 250/1000 but…
RDev
  • 33
  • 4
1
vote
1 answer

call revert exception when calling a view function with Panic code 50

I'm getting an error when calling a view function of my solidity contract from my frontend. The error is listed in the docs as error 32: 0x32: If you access an array, bytesN or an array slice at an out-of-bounds or negative index (i.e. x[i] where i…
Fede
  • 1,656
  • 4
  • 24
  • 42