Category "solidity"

How to add royalty fee to NFT collection

I am currently learning about NFTs and I reached the point where I deployed the contract and I can mint and everything going well. The only missing part is roya

Ethernaut challenge -Lv22 Dex - allowance approval problem

I'm trying to complete the Dex level of ethernaut challenge which is quite easy. In order to use swap I need firstly to approve token allowance, but I don't und

ERC721A smart contract

I'm writing an ERC721A smart contract and getting a warning in the Remix IDE. There is the code: function tokenOfOwnerByIndex(address owner, uint256 index) pub

I can't get "Typechain" folder when I install dependencies using hardhat

When I install all the dependencies but didn't get the "typechain" folder in the typescript hardhat. how to get it? npm init npm install --save-dev hardhat npx

Getting a smart contract, web3 python

How can I access smart contract calls with only the address of the contract? Correctly, I understand that the address will be enough, because with the help of i

Deploying a Smart Contract

If I were to deploy a smart contract for NFT's that I would want to sell which is the best way to do this. And is utilising Injected Web3 on Remix.ethereum.org

Passing a Struct Array to constructor of Solidity Contract

I am building an NFT smart contract with solidity, and I am trying to pass and Array of Structs into the constructor when I deploy the contract. However I am ge

ERROR Brownie Mainnet Fork Testing `brownie.exceptions.VirtualMachineError: revert` problem or other?

When I try to test below project, it gets below error. Any thoughts why test fails, am I missing something? I am following 16 hours Solidity course of 'freecode

Solidity Error: member balance not found or not visible after argument-dependent lookup in contract

I'm getting this error in Solidity for the following code snippet: member balance not found or not visible after argument-dependent lookup in contract functio

ERROR: brownie.exceptions.RPCConnectionError: Able to launch RPC client, but unable to connect

The ganache-cli is unable to connect to the mainnet fork, as a result of which I can't run brownie test --networks mainnet-fork My test.py file looks like this:

can't import module from solidity file to python file in brownie; ImportError: cannot import name 'AdvancedCollectible' from 'brownie'

I'm trying to build out this tutorial, but I keep getting the same error when I try to import from a solidity file to a python script and run it, all in the sam

ParserError: Source file requires different compiler version (current compiler is 0.8.7+commit.e28d00a7.Emscripten.clang)

I was eventually trying to run this code in remix IDE, where I was running this using 0.6.6 version of Solidity and ran into this error. I've tried using some o

Web3 Cannot get value of a public variable from contract

Solidity code: pragma solidity ^0.5.8; contract remainNew{ address public owner = msg.sender; uint public cubeCount = 0; modifier onlyBy(addr

UseDapp - useCall - How to get return value from Solidity function?

I am still quite new with react and solidity and don't know where to start. I can update a String and want to print it out after I changed it. But I want the St

VS Code 2 errors: 1st is "Import 'solcx' could not be resolved." 2nd issue is given in terminal as "INFO: Could not find files for the given patterns

Here is the code from solcx import compile_standard, install_solc import json with open("./SimpleStorage.sol", "r") as file: simple_storage_file = file.rea

Error in plugin @nomiclabs/hardhat-etherscan: The contract verification failed. Reason: Fail - Unable to verify - with arguments

I am trying to verify my contract with arguments and I am getting this error: Error in plugin @nomiclabs/hardhat-etherscan: The contract verification failed. Re

Uploading metadata to IPFS using Pinata API for NFTs

I'm having an issue uploading my metadata to Pinata via their API. I've tried it in a test file and it works perfectly, but in my larger file, it's throwing an