Category "solidity"

How to initialize a static string array in solidity?

I want to declare an array to store my strings as follows. bytes32[3] verifiedResult; verifiedResult = ["verified successfully", "verified failed", "not clear"]

My dapp doesn't detect when an user change their Metamask Account

I am in the process of building a dapp for a project. I have one last thing to adjust: detect when a user changes metamask account to reset the state but it doe

How to initialize a static string array in solidity?

I want to declare an array to store my strings as follows. bytes32[3] verifiedResult; verifiedResult = ["verified successfully", "verified failed", "not clear"]

TypeError: Cannot read properties of undefined (reading 'getContractFactory') when testing contract

First question so bare with me if it is not very clear, but I'll try my best. I am currently running through a youtube video to test my contract with hardhat, e

sign and verify message with solidity and python

I am trying to perform a certain action say like selling a token only when the message sent to a contract is signed by the contract owner. I knew how I would do

Can smart contracts deploy other smart contracts?

If a smart contract has the compiled bytecode for a contract can the first deploy a subsequent contract? According to Ethereum.org: "To deploy a smart contract,

Error: VM Exception while processing transaction: reverted with reason string 'ERC721: transfer caller is not owner nor approved'

i try to write NFT marketplace and i have problem with reselling items from user that buy item from owner and new, third user. I use next.js + openzeppelin + ha

Member "name" not found or not visible after argument-dependent lookup in struct xxx storage ref[] storage ref

Solifity 0.8.0 with struct struct Placeholder{ string a; uint256 b; } mapping(uint256 => Placeholder[]) public placeholder; why this error Member "b" no

ImportError: No module named solcx

I installed py-solc-x via pip3 install py-solc-x in the terminal but when I run the program, I still get an importerror. What's going on here? My code: from sol

ParserError while compiling solidity code

I am new to solidity. This is my 1st simple project when I do node compile.js & I am getting following error: My Error : { contracts: {}, errors: [ ":

Unhandled Rejection (Error): call revert exception

I am getting this error message when trying to interact with my smart contract on my react front end. I am running localhost3000 and which requires metamask to

Visual Code Studio, File Import Callback not Supported - File Source not Found

While trying to troubleshoot another issue with my project, I must've broken something along the way, but I have no idea how to fix this. These are my import st

How to store each NFT image in a ERC721 contract? [closed]

When creating a ERC721 contract that manages thousands of image NFTs, saving these image byte pixels in arrays on the contract doesn't seem ve

How to store each NFT image in a ERC721 contract? [closed]

When creating a ERC721 contract that manages thousands of image NFTs, saving these image byte pixels in arrays on the contract doesn't seem ve

Trying to run a Brownie Dapp in Docker

I'm trying to run my brownie dapp in a docker container, but i always have the same error and can't seem to fix it: FileNotFoundError: [Errno 2] No such file or

How do I set Royalty on OpenSea from my DApp?

The project we are supposed to make is a minting page that can set royalty fee on opensea testnet from the dapp itself (i.e. you cannot set it from open sea's i

totalsupply() is not a function openzeppelin contracts

I'm trying to import some contract files from open zeppelin so my solidity smart contracts can inherit their functionality, when trying to write chai tests that

eth-brownie - No module named <Users.someuser>

Getting this error while trying to run a eth-brownie script on MacOS ModuleNotFoundError: No module named 'Users.xyz' Run command: brownie run scripts/mainne

Getting error while deploying smart contract using truffle

2_deploy_contracts.js ===================== Replacing 'SimpleStorage' ------------------------- Error [ERR_UNHANDLED_ERROR]: Unhandled error. ({ code:

ParserError: Expected identifier but got 'payable'

This is the code thats giving the error, the line is set to bold. //SPDX-License-Identifier: UNLICENSED pragma solidity ^0.8.13; contract CrowdFunding{ mapp