Category "solidity"

BSC Testnet addLiquiditiyETH TRANSFER_FROM_FAILED

I'm coding an bep20 token and if I want to add Liquidity with pancakeswap I get the following error: ProviderError: Error: VM Exception while processing transac

Member "team1Score" not found or not visible after argument-dependent lookup in type (contract Game) - Solidity

I'm on a course and have run into a problem. I am trying to make a function that shows the difference in team score from the perspective of the team in the vari

Not getting event from smart contract on ethers.js

I have contract this part is simply creating smart contract for NFT. At the end of the createToken() I am emitting event. // SPDX-License-Identifier: MIT OR Apa

How to get balanceOf of tron smart contract

I am using tronlink chrome extension and trying to call balanceOf method of a smart contract. I am very new to smart contract. Unable to find any solution. Plea

Mock smart contract solidity - can't deploy mock smart contract - TypeError: Contract "mockMyToken" should be marked as abstract

I wrote a smart contract that uses openzepplin ERC20 standard. I am able to deploy it using truffle and my tests work as expected. I am now trying to test part

Ethers.js: Solidity method arguments of type "contract": Error: invalid address or ENS name

I'm trying to invoke the following solidity function from ethersjs (it takes another contract as argument): function getReservesData(IPoolAddressesProvider prov

brownie AttributeError: 'NoneType' object has no attribute 'getEntranceFee'

Macbook Pro : Monterey Intel Core i7 Brownie v1.17.2 I am learning solidity according to reference(https://www.youtube.com/watch?v=M576WGiDBdQ&t=25510s). Wh

throw new Error 'Returned values aren't valid, did it run Out of Gas?

I am getting this error: Error: Returned values aren't valid, did it run Out of Gas? You might also see this error if you are not using the correct ABI for the

I am finding it difficult to initialize package.json file in my truffle project

I can not install package.json dependencies in my truffle project and I have tried touch.json. it's giving me errors. I have also tried truffle init, but it is

python sintax problem for solidity compilator

I have problem connected to python. I want to compile solidity files using python. But getting error. import json from solcx import compile_standard, inst

Command 'Solidity: Compile Contract' resulted in an error (Cannot read properties of undefined(reading 'uri'))

Good day everyone, I am working on a lottery smart contract. I am currently done with the remix VM tests and proceeded with the unit tests with JavaScript. The

ethers can't get pure function return value

I built a test solidity pure function to display a greeting message. It only returns a string "Hello User". Here is the contract code: //SPDX-License-Identifie

Can't verify ERC20/BEP20 token on BSCScan

I deployed an ERC20/BEP20 token on binance smart chain using truffle and openzepplin. Now I want to verify this smart contract but I have some issues. $ truffle

Brownie downloads solc every time I run compile

I'm using Visual Studio Code and every time I run brownie compile I get this which takes a good while (and also I can't compile without internet connection): I

How to set price for all NFTs in a collection on opensea?

If I mint a collection of n items on my own address (via smart contract) , it'll be publicly visible on my account under the collected / created section like th

How to create a simple swapping contract

I want to create a contract that buys and sells to a fixed price which can be set with a contract interaction onlyOwner basically i need a token vendor with edi

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

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

Solidity library @openzeppelin/contracts/access/Ownable.sol is not resolving ownerOnly()

I am trying to switch my contract to use the 'import "@openzeppelin/contracts/access/Ownable.sol”’, but I am getting the following error contracts/I

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