Category "smartcontracts"

window.solana not found on js web3

I want to connect a Solana wallet (phantom or any other) to a web aplication through the js web3 library. I've read docs for most wallets and it seems like it's

.balanceOf is not a function - Interact with existing Contract on Blockchain

I want to automate my staking on The Sandbox. For that I need in the first step to interact with the mSand-Matic Pool Contract. It is this one: https://polygons

AttributeError: 'NoneType' object has no attribute '_with_attr' - Python running tests with pytest

My environment is : Python 3.9.9 Pytest 6.2.5 Brownie 1.17.1 I'm working on the test_fund_me.py from Patrick Collins' Smart Contract tutorial on Youtube; at thi

What is the 16 in (chainId, 16) in an Eth smart contract that is on the Rinkeby network

I am new to smart contracts and I am working on an Eth Rinkeby dapp and was wondering if anyone can tell me what the "16" means in this section: } network =

How to deploy multiple smart contracts using hardhat-deploy

I have two smart contracts that I want to deploy. I want to deploy the first one, then pass the address of the first into the constructor of the second one. I a

Restrict function access ONLY to one other specific contract in Solidity

I have a security problem in my Solidity contracts and I can't figure out how to fix it. The flow goes like this: First, we create an instance of contract A; Cr

error[E0412]: cannot find type `ProgramResult` in this scope

use anchor_lang::prelude::*; declare_id!("Fg6PaFpoGXkYsidMpWTK6W2BeZ7FEfcYkg476zPFsLnS"); #[program] pub mod myepicproject { use super::*; pub fn start_st

Matic Remix Warning! Error encountered during contract execution [execution reverted]

I forked a contract, it is a Baked Beans fork on MATIC, I deployed the contract through Remix, now when I try to deposit through my website script, Metamask say

How to send ETH to a contract function with ethers.js?

I am trying to send ETH to a contract function from a web app via metamask and ethers.js. So far I have tried: const provider = new ethers.providers.Web3Provide

how can i call a function in a smart contract from an abi json file smart contract

i have the abi json file for a contract and i want to use its functions in my smart contract. is there any way to do it? for example i have a contractA.sol and

Invalid signature error from ethers when trying to verify a signature

I am working on a dapp that needs to verify users' signatures. When testing with Metamask, everything is okay. When trying to verify a signature from Ambire wal

Paying with ERC20 token

I want to build an NFT that I can paid with an ERC-20 token to mint it. I'm using currently the Mumbai testnet on polygon, and I'm using the Dummy ERC20 token t

Error trailing semicolon in smart contract on solidity?

I am trying to write a smart contract and line 1 is bringing up an error : ParserError: Found version pragma, but failed to parse it. Please ensure there is a

The transaction declared chain ID 5777, but the connected node is on 1337

I am trying to deploy my SimpleStorage.sol contract to a ganache local chain by making a transaction using python. It seems to have trouble connecting to the ch

Failing transaction when calling a funciton from geth console

I am discovering the blockchain world step by step, but I am facing a problem that I can't solve. I am using this simple smart contract from the Solidity docume

Where do I store metadata of NFT

Smart contract execution needs gas fee. So all data can't be stored in blockchain. Images could be stored on ipfs like Pinata. Do I have to develop extra backen

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,

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

Ethereum - insufficient funds for intrinsic transaction cost

I'm trying to create my own NFT contract factory, but it fails in mainnet. I have ETH on my wallet. In test it works fine. Here's my contract: //Contract based

Truffle installed but not working properly

I'm using node version 12.20.2 and npm version 6.14.11 and installed truffle with cmd as administrator, the truffle framework version 5.5.12 has been installed