Questions tagged [truffle]

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

Filter by
Sorted by
Tagged with
1
vote
1answer
108 views

How to call variadic function in erc223 contract

There is two transfer function in my contract, And i m trying to call transfer function of erc223 for transfer token to contract address using this function. Token.deployed() .then(function(i) { ...
0
votes
1answer
39 views

Difference between the way methods are called in smart contract

What is the difference between instance.totalSupply() vs instance.methods.totalSupply().call() To my knowledge one is for truffle and the other is for web3. But truffle also uses web3 then why can ...
0
votes
0answers
44 views

Error when testing the contract

ApprovalContract.sol pragma solidity ^0.5.1; contract ApprovalContract{ address public sender; address payable public reciever; address public constant approver=...
0
votes
1answer
47 views

Gas amount to store a contract?

i'm trying to run truffle migrate and it gives me always this error. Error: The contract code couldn't be stored, please check your gas amount. MBP-de-Alicia-2:smartContracts alicialombarte$ truffle ...
1
vote
1answer
17 views

Upgradability Proxy ADMIN_SLOT assembly sstore does not update

I'm currently playing around with Proxy Upgradability, and noticed the use of assembly in terms of the new upgraded contract and the slot assigned. Real implementation can be seen here. I have ...
0
votes
1answer
35 views

I am getting error while installing truffle in Ubuntu 16.04 LTS. How to resolve this issue?

When i enter this command: sudo npm install -g truffle I get the following error: > truffle@5.0.27 postinstall /usr/lib/node_modules/truffle > node ./scripts/postinstall.js Error: EACCES: ...
0
votes
2answers
63 views

File import callback not supported import “./IERC20.sol”;

when I try to compile my contract I see errors like this : DemirelToken.sol https://eksiup.com/p/4z49413damc3 here's the code : pragma solidity ^0.5.0; import "node_modules/openzeppelin-...
0
votes
1answer
23 views

How does a transaction verified with Truffle test?

I'm a new to Ethereum and Solidity, and I don't understand how Truffle executes transaction calls. From what I learned and understood, if I try to use a contract method which changes the contract's ...
2
votes
1answer
27 views

Kaleido private network transaction exited with an error (status 0) after consuming all gas

I've created a private PoA network with two geth nodes using Kaleido (release 1.0.13) and am trying to deploy some smart contracts to it using the drizzle-kaleido-box boilerplate from truffle. The ...
0
votes
0answers
18 views

Smart-contracts referencing each other [duplicate]

How would one retrieve these three addresses in the "Knot" smart-contract? I am very new to this, and would like to know whether this is even possible. The "Knot" contract should be able to reference ...
0
votes
1answer
54 views

Reverted tx on Ropsten but gas limit not reached

This is a timed crowed sale contract https://ropsten.etherscan.io/tx/0xaa3fa69a32060ad578cb9bc2a94fcc4cf7109f4e743f54c527c18f764f634ebb Error encountered, bailing. Network state unknown. Review ...
0
votes
1answer
17 views

Issue with Serverless deploy of smart contract-Dependency mismatch -Package.json,Package-lock.json error

I'm trying to deploy my smart contract serverless(AWS lambda) and I'm using Truffle framework. The code is getting deployed in an earlier system(earlier it was deployed here). Now I have updated the ...
0
votes
0answers
27 views

uncaught error:invalid address

Uncaught (in promise) Error: invalid address at inputAddressFormatter (formatters.js:271) at inputTransactionFormatter (formatters.js:97) at method.js:89 at Array.map (<anonymous>...
1
vote
1answer
15 views

truffle migrate --network kovan issue

When I run truffle migrate --network kovan in the terminal the contract deployment doesn't run. Just: Compiling your contracts...==================== >Eveything is up to date, there is nothing to ...
2
votes
1answer
55 views

Transaction execution and interacting with truffle

pragma solidity ^0.4.23; contract Hotelbooking{ address receiver; function deposit(uint256 _amount) payable public { require(msg.value == _amount); // nothing else to do! ...
1
vote
1answer
58 views

Smart contract - OpenWeatherMap API

I'm wanting to create a smart contract that sends an amount of ether to an address when the weather is above 30 degrees for 3 or more consecutive days, using the OpenWeatherMap API. How can I use ...
1
vote
1answer
46 views

ERC721 Transfer Event issue

Looking at the open-zeppelin ERC721 Contract's code, I see that the very last thing that its mint function is doing is call emit on the contract's pre-defined Transfer event. My question is: how do ...
1
vote
0answers
22 views

Cannot read property 'type' of undefined - abi-coder

I'm creating a simple voting contract. It is deployed with truffle and infura. This is the contract code: pragma solidity >=0.4.21 <0.6.0; contract Voter { struct OptionPos { uint ...
0
votes
1answer
62 views

Truffle console no compile or init options

While using truffle.cmd console I tried to use the compile option, or even init. These options are not available, so I cannot compile using console. truffle(development)> .help .break Sometimes ...
0
votes
1answer
19 views

Failed to install Truffle on MacOS Mojave

I am currently really struggling in getting Truffle up and running. I am running MacOS Mojave and have Node (v.10.16.0) and NPM (6.9.0) and have tried npm install -g truffle and have gotten: ...
1
vote
2answers
163 views

How are truffle artifacts different from ABI?

How are truffle artifacts different from ABI? Do Truffle artifacts include fields that are different from ABI that is generated using remix?
1
vote
1answer
29 views

During gas-free transaction get an error “No relay responded! 4 attempted, 4 pinged”

I did all modification related to this instruction https://github.com/tabookey/tabookey-gasless However, when I'm trying to write some tests it fails and provides me the following error Error:...
1
vote
1answer
61 views

Not able to send Ether to contract

I am trying to send Ethers to a contract deployed on Ganache but I am getting VM Exception while processing transaction: revert, the same logic is able to transfer Ethers to other account. Following ...
1
vote
1answer
104 views

Deploy smart contract on Ropsten using truffle-hdwallet-provider

I have 7 smart contracts to deploy on the Ropsten network. I am using truffle-hdwallet-provider and below is the content of my truffle.js file: module.exports = { solc: { optimizer: { ...
3
votes
1answer
1k views

Transaction gas cost in truffle test case

Below is from a truffle test cases in javascript, where I was trying to add the gas cost to an account balance to confirm the sum of transaction, where the sum should be equal to the previous balance. ...
1
vote
0answers
11 views

estimateGas works on Truffle, but fails on geth

I'm trying to estimate the gas required for deploying a smart contract. It works fine in Truffle, but fails in Geth for some weird reason: truffle(develop)> await web3.eth.estimateGas({ data: '...
0
votes
1answer
52 views

Unable to change the length of a global 2D storage array

I am facing difficulties changing the length of a global 2D storage array. It seems to be working correctly on Remix IDE, but when I try to test it on ganache-cli (formerly known as testrpc) - either ...
1
vote
1answer
66 views

Which one of methods should I choose for deployment of smart contract geth or a wallet if I have to build API for smart contracts in nodejs?

I'm having trouble to understand which method would be better for deployment geth or a wallet if I'm building API in nodejs using web3. Where exactly is the contract stored?? Is the contract ...
0
votes
2answers
73 views

Solidity: uint parameter not being set properly

Testing my contract locally with truffle. I have a function with the signature: function purchase(address buyer, address seller, bytes16 bookId, uint tokens) public onlyOwner returns(bool success) ...
1
vote
0answers
19 views

“truffle init” not working after installing

After I install truffle with: $ npm install -g truffle And get: /usr/local/Cellar/node/12.5.0/bin/truffle -> /usr/local/Cellar/node/12.5.0/lib/node_modules/truffle/build/cli.bundled.js ...
1
vote
1answer
132 views

Truffle Deploy gas limit exhausted

I kept on getting this error. 9/10 of my deployment will fail. But out of the sudden it will be success without any reason. I have checked the transaction receipt and indeed it had reaches the gas ...
1
vote
1answer
37 views

Getting the transaction hash on function call

I am new to Solidity, Web3, and Ethereum. I am trying to build a web application through which users can upload a file to IPFS, then store the IPFS hash in the blockchain. I am using the React truffle ...
1
vote
1answer
166 views

UnimplementedFeatureError: Encoding type “struct BiddingContract.Bidder memory” not yet implemented

The code is broken with the new upgrade v0.5, using Truffle v5.0.1 (core: 5.0.1) struct Bidder { address bidders_address; uint productId; uint bidValue; } struct Product { uint ...
0
votes
2answers
41 views

Error: Invalid number of parameters (regular getter function). Got 0 expected 1!

Playing with drizzle, I am trying to use a getter for an uint variable campaignCounter, that gets incremented by 1 whenever a factory creates a new campaign. Here is my component's code: import ...
0
votes
1answer
122 views

Solidity: How are multiple return values returned?

Working in truffle with TDD testing and am getting some errors when evaluating the return values of some functions. If a function is returning multiple values in Solidity, how are they presented? Is ...
0
votes
1answer
32 views

I can't migrate the contract using truffle init

I am working to build a Dapp using Ganache, Web3, and Truffle frameworks. I am unable to compile the contracts using truffle compile. I am facing an error. I want to explain you in detail what I did. ...
0
votes
1answer
33 views

I keep getting the error: “Uncaught (in promise) Error: Invalid number of arguments to Solidity function”

I have tested it in remix and the function does work, I also removed inputs just for testing purposes but it seems that it doesn't work anyway. Here is the function: struct Message{ string ...
0
votes
0answers
30 views

Hosting pet-shop DApp on IPFS - JSON Files problem

I am trying to host DApp "pet-shop" which one of the truffle boxes on IPFS. rsyncing of src, build/contracts and ipfs add files went very well and there are plenty of peers as seeders on the network ...
1
vote
2answers
33 views

How to test events that were sent by inner transaction / delegate call?

Usually, using truffle I can check for events like this: let { logs } = await myContract.doSomethingImportant( xxx ); // 1500 tokens are expected to get expectEvent.inLogs(logs, '...
2
votes
2answers
167 views

Error when running Truffle Test in Terminal

I am trying to use truffle to test my smart contracts and have written some test files. I am getting an error on the terminal trying to run the test and am unsure what the reason is. I access my ...
1
vote
0answers
122 views

Transaction exited with an error (status 0) after consuming all gas

I developed some smart contracts to be deployed to a private PoA (Proof of Authority) blockchain. I spun up a private blockchain via truffle develop and got the following receipt: Compiling your ...
0
votes
1answer
83 views

Not able to deploy contract in testnet(Ropseten)

I am trying to deploy a crowdsale contract which is build upon openzeppelin while deploying it on geth --dev and ganache it gets deployed perfectly but whenever I am trying to deploy the contract on ...
0
votes
2answers
31 views

Unused function parameter. Remove or comment out the variable name to silence this warning

I have a smart contact which have 2 owner address and 3 functions. my set functions is set a users with msg.sender and my getUser functions is returns name,surname and age and I want to add a admin ...
0
votes
1answer
36 views

Calling Smart Contract function returns tx object instead of expected return value in Truffle test

I have started writing a smart contract for a gift registry. When I write tests using the Truffle Framework I get unexpected return values. For example, when calling the offerGift function from ...
0
votes
0answers
40 views

Truffle Contract deployment >> Error: Returned values aren't valid, did it run Out of Gas?

I have a rpc enabled running private ethereum blockchain node with mining enabled. I have connected to it using metamask and have performed some contract interactions (deployment, calling functions,...
0
votes
1answer
40 views

Truffle contract.deployed does not get the latest instance deployed

I am developing a back-end DApp using truffle and nodejs on a private network. My application call Contract.deployed() and print the address of the obtained Contract. When I call truffle migrate --...
0
votes
1answer
60 views

Contract testing works in solidity but fails in truffle - testrpc

I have a contract like this: PublishService.sol, the strings.sol is taken from here. pragma solidity ^0.4.0; import "./strings.sol"; contract PublishService { using strings for *; struct ...
0
votes
2answers
29 views

Truffle migrate --network ropsten always runs development network

I am trying to deploy a simple contract to the Ropsten network using Truffle and Infura. I have set up the Ropsten network in the truffle-confug.js file but it seems truffle always uses the ...
6
votes
3answers
7k views

What is the correct way to access public variable from contract in Truffle: then or standard callback?

There are some similar posts to this but none seem to be able to solve my problem. I have a contract deployed with Truffle running with testrpc. I want to access the value of a public uint variable ...