Questions tagged [truffle]

Questions regarding the implementation and use of the Truffle development and testing environment.

Filter by
Sorted by
Tagged with
0
votes
0answers
3 views

Send LP tokens to a payable function using truffle console

I am trying to stake the LP tokens that I got after adding liquidity in pancakeswap contract function. I can see the LP tokens in my metamask wallet as well. Now I cant understand how will send some ...
0
votes
0answers
8 views

'Transaction nonce is too low. Try incrementing the nonce.' while following truffle tutorial

I ran into a nonce error on the last leg of this tutorial : https://www.trufflesuite.com/boxes/flashloan-box I also supplemented the tutorial with this video on yt(fyi b/c some of the code comes from ...
0
votes
0answers
5 views

Get rid of “All auditors failed!” on OpenGSN transaction

I'm trying to make a transaction to the rinkeby testnet using OpenGSN v2, I've aleready set up everything needed but the transaction keeps reverting. Here is one example of that revert: ...
0
votes
0answers
9 views

RangeError: Maximum call stack size exceeded or Contract code size over limit, yet this is just a copy of a contract already deployed

I am trying to create a DeFi app that works with PAXG gold token. But in order to do this, I need to first be able to deploy a copy of PAXG on my local testnet (Ganache). I have forked the github and ...
0
votes
0answers
7 views

What is the purpose of a dry run in truffle?

What is the purpose of a dry run in truffle? I mean apart from showing you how much it will cost to deploy your contract?
2
votes
1answer
15 views

Can I Specify gas fees in the smart contract?

Deploying my contract on rinkeby cost ~12 USD in gas fees (using truffle cli). Is it possible for me to specify gas fees/set a limit in the smart contract so it costs me 0.5 USD, but takes longer to ...
0
votes
0answers
9 views

Truffle migrations error: Transaction was not mined within 750 seconds, please make sure your transaction was properly sent

My env Truffle v5.3.1 (core: 5.3.1) Solidity - ^0.8.0 (solc-js) Node v15.11.0 Web3.js v1.3.5 my truffle-config file const HDWalletProvider = require('@truffle/hdwallet-provider'); require('dotenv')....
0
votes
0answers
9 views

How do I efficiently install truffle and ganache-cli in a docker container?

Say I want to run a container with ganache-cli and truffle installed for dev purposes. I have this first attempt Dockerfile FROM node:15-alpine RUN mkdir -p /home/node/app WORKDIR /home/node/app ...
1
vote
0answers
74 views
+100

Transaction exited with an error 0 [pancakeswap]

I am trying to make a few transactions on binance test net using a script in solidity and truffle which is a clone of PANCAKESWAP. I was able to successfully compile and execute the script once. When ...
0
votes
0answers
30 views

Calling function from web3 fails, calling it from truffle console works

I have the following JS code to call a contract: const txHash = await timelockContract.methods.executeTransaction( "0x71c1179e3C351De2641845cDAe537aCFC1808Fd2", 0, "&...
0
votes
1answer
22 views

Truffle cant find script file

I am trying to execute a script in my truffle project. The script is located in the scripts folder. But whether I run the command from within the root of the project or inside the scripts folder, it ...
0
votes
0answers
20 views

Undeclared identifier _setTokenURI in ERC721

I'm using pragma solidity ^0.8.0; I heard that _setTokenURI was removed in pragma 0.8.0 I tried these options https://forum.openzeppelin.com/t/function-settokenuri-in-erc721-is-gone-with-pragma-0-8-...
0
votes
0answers
10 views

Truffle test - doesn't send funds to msg.sender

it seems like I have a wrong gnache or truffle setup ... I already ask a simular question here: Owner of contract is set to contract address? Basicly there is some mess up with addresses on my local ...
0
votes
1answer
8 views

“Uncaught ReferenceError: TodoList is not defined” as I tried to call Todolist.deployed() in truffle console

I was trying this Beginner tutorial on smart contracts and solidity. I typed truffle compile, truffle migrate and they ran without any error and I got my gas cost used up in Ganache. When I opened ...
0
votes
0answers
45 views

Truffle deployment to BSC main net fails [closed]

Im trying to deploy my smart contract to BSC, I had 0.13 bnb on my account which at that time was worth (100$), I tried many times and funds are gone now... Is 100$ not enough for deploying a bunch of ...
0
votes
0answers
8 views

How to make a deployer in truffle tests?

For some reason, our app will only work with a forked instance of the mainnet. And hence, we want to run our test on the forked ganache. We are using truffle, so we have written all of our tests in ...
0
votes
1answer
23 views

When I run truffle compile I get a ParserError: syntax error

Error i'm getting back when I run truffle compile ParserError: Expected ';' but got 'contract' How my contract looks: pragma solidity ^0.6.0; import "@openzeppelin/contracts/token/ERC721/...
1
vote
1answer
21 views

UniswapV2 addLiquidity revert ds-math-sub-underflow

I'm trying to use Uniswapv2Router with Truffle and Ganache, but haven't been able to identify what I'm doing wrong. I'm using addLiquidty method as follows: await uniswapV2Router02.addLiquidity(token0....
0
votes
1answer
30 views

Truffle test doesn't connect to Ganache

I'm using Truffle and Ganache for my development environment. Using the truffle console or truffle external scripts everything works fine, but truffle test does not seem to be connected to Ganache: ...
0
votes
1answer
16 views

Truffle console call contract without ABI (Ganache Forked BSC)

So I started Ganache-cli with -f option to fork the BSC (ETH FORK), and in the truffle console I want to interact with some smart contracts that are not mine nor I deployed them, how can I interact ...
0
votes
1answer
24 views

Big discrepancy between the cost of deploying to the test net and the main net

I have a simple 100-line contract with 6 functions that I want to deploy to the main net. When I deploy it to the Rinkeby test net through Truffle, I get the following result: Summary ======= > ...
0
votes
2answers
22 views

infura.io secret configuration in HDWalletProvider (truffle-config.js)

I have set a secret for my project in infura. Here is my truffle-config.js file: module.exports = { networks: { ... ropsten: { provider: new HDWalletProvider(mnemonic, "https://...
0
votes
0answers
9 views

Truffle test is failling with transferFrom.call

When I run tests with the following code, I get the following error: Error Error: Returned error: VM Exception while processing transaction: revert Tests it('Handles delegated token transfers', () =...
0
votes
1answer
16 views

Connect local frontend with smart contract on ropsten

I'm new to DApp programming an I'm struggling with this problem since two days now. Cloned this github example: https://github.com/dappuniversity/election I deployed the smart contract to ropsten with ...
0
votes
0answers
14 views

Using functions from a library

I'm working on a Dapp for voting in a municipality and national election. There is a lot of code, and I've met the max limit of the contract size many times but have been able to keep it under the ...
0
votes
0answers
14 views

What is your Solidity Stack of choice? [closed]

Fun question here. What is your stack of choice and why? I was reading https://hackernoon.com/the-new-solidity-dev-stack-buidler-ethers-waffle-typescript-706830w0 And got inspired to ask the community ...
1
vote
1answer
17 views

Dapp using react-native and truffle

I have a blockchain dapp which is working fine in web browser. Wallet : Metamask OS : Ubuntu 20 Node : 10.19.0 Npm : 6.14.4 But, I would like to run the dapp in mobile view using truffle ...
1
vote
1answer
95 views

Correctly compiled contract on remix returns empty ABI

I have two questions. My contract has compiled and deployed successfully both using remix and truffle. However: q1) remix returns an empty array of ABI. Also, after I hit compile the contract at the ...
1
vote
1answer
13 views

Explore transaction from truffle test file

I have create this test: const { expectEvent } = require('@openzeppelin/test-helpers'); const MyContract = artifacts.require('MyContract'); contract('MyContract', function (accounts) { const [...
0
votes
1answer
18 views

How can i properly git a truffle/react project

Here is what i've done in a blank directory: $ truffle unbox react $ npm install @openzeppelin/contracts $ npm install @openzeppelin/test-helpers $ npm install @truffle/hdwallet-provider Then, i have ...
0
votes
0answers
27 views

Owner of contract is set to contract address?

I just testing a contract with truffle and Im wondering why the owner of the contract is set to the contract address itself. Migrations: const contractA= artifacts.require("ContractA"); ...
1
vote
1answer
26 views

Solidity: ParserError: Expected pragma, import directive or contract/interface/library definition. function

I am using Truffle together with Ganache and I can't get this code to run: pragma solidity >=0.4.21<0.6.0; import "@openzeppelin/contracts/token/ERC721/ERC721.sol"; import "@...
0
votes
0answers
10 views

Deployed truffle contract: Cannot create instance of <contract>; no code at address

I deployed my contract at 0xa518a732606baae1c72490313cb7bb42c62c7a50. Now, what I try to do is to interact with my functions.. I've created an node.js application over web3 and truffle/contract but I ...
0
votes
1answer
12 views

Error in passing a contract or interface as parameter to a function

I have seen some examples of Contracts where people are passing other Contract or Interface as a parameter. (Linear example, Synthetix example. However, when I was trying it in one of my contracts, I ...
0
votes
0answers
18 views

Debugging mainnet contract [duplicate]

I'm hoping to be able to debug a main net transaction without needing to pay the gas fees to have it fail. Metamask tells me that it is going to cost 1.8 eth to run the transaction so I cant exactly ...
0
votes
0answers
12 views

Error in running truffle test [duplicate]

D:\Truffle Projects\payable>truffle test Compiling your contracts... =========================== > Compiling .\contracts\First.sol > Compiling .\contracts\Migrations.sol > Compiling .\...
0
votes
0answers
15 views

Error: Returned error: VM Exception while processing transaction [duplicate]

Gettting Error: Returned error: VM Exception while processing transaction function getLatestPrice() public payable returns (int) { ( uint80 roundID, int price, ...
1
vote
1answer
20 views

Fail to deploy contract on rinkeby using truffle and metamask

Following is a snippet from my truffle-config.js file networks: { // Useful for testing. The `development` name is special - truffle uses it by default // if it's defined here and no other ...
0
votes
0answers
7 views

Signer Address Recovery

I have these 2 functions in my contract with help of which I want to recover the address of the signer: function formSigningData(address NFTAddress, uint NFTId, uint amount, address tokenAddress, uint ...
0
votes
1answer
12 views

expectEvent with string returning a non-string value

I am using expectEvent from OpenZeppelin's Test Helpers, and when running a Truffle test to check the event, it's all fine for address and integer fields, but have an issue for string type. Given a ...
1
vote
0answers
39 views

Is it possible to create a button “connect to wallet”?

I'm learning web3 and blockchain in general. I'd like to create a button that says "connect to wallet " in order to connect with metamask wallet, but I do not know if 1- I need to connect ...
1
vote
1answer
30 views

Is it possible to use a smart contract without connecting to a wallet?

I've a web application where I have some structure with ids and a function to get prices by an id from an smart contract, and I've payable functions. I'm not able to show prices for each item if I don'...
0
votes
0answers
40 views

Uncaught Exception: Unknown error when sending transaction

I am trying to deploy a Smart contract using truffle / web3js. The script has been deploying smart contracts for months and I am suddenly facing this error: error: uncaughtException: Unknown error ...
0
votes
0answers
7 views

How to instantiate a new contract using web3swift

How do you instantiate a new contract using web3swift? I'm currently invoking the contract methods in the following way: guard let contract = web3Rinkeby.contract(someABI, at: ethContractAddress, ...
0
votes
1answer
11 views

Get The Address Of the Deployer Of Contract In Truffle Test

How can I get the address in Truffle that calls functions of the contract by default(When we don't use the {from: accounts[i]} statement)?
0
votes
0answers
3 views

ReferenceError while running the truffle test

I am getting the ReferenceError while executing truffle test, I got it from a book: //Greeter.sol pragma solidity >=0.4.0 <0.7.0; contract Greeter{ function greet() external pure returns(...
0
votes
1answer
9 views

Truffle Migrate Endless Run

I am trying to deploy my contracts with const Migrations = artifacts.require("Migrations"); const Market = artifacts.require("Market"); module.exports = function (deployer, ...
0
votes
0answers
16 views

truffle flattener cannot find part of path

I am trying to flatten a solidity file but I keep getting cannot find part of path error as shown below out-file : Could not find a part of the path 'D:\Blockchain\bullrun\src\contracts\ERC721.sol'. ...
0
votes
1answer
208 views

How to get rid of “Visibility for constructor is ignored” warning

In VS Code I get this warning in my contract constructor: Visibility for constructor is ignored. If you want the contract to be non-deployable, making it "abstract" is sufficient. So I ...
0
votes
1answer
44 views

Truffle Install // npm WARN and Vulnerabilities — How i solve that issues?

I want to start working with Solidity in my Visual Studio Code so i installed Visuall Studio Code first, then nodejs and npm and in the end i try to install Truffles. -I work on Window 10 OS -Nodejs ...

1
2 3 4 5
49