How to create an instance of contract in Truffle console

0 votes

Hi,

I am trying to learn truffle form the following link:

https://medium.com/@JusDev1988/reentrancy-attack-on-a-smart-contract-677eae1300f2

I am writing the following command at Truffle console to create an instance of the deployed contract but I am getting the message "undefined":

Victim.deployed().then(contract => victim = contract)

undefined

truffle(ganache)> truffle version

Truffle v5.1.27 (core: 5.1.27)
Solidity v0.5.16 (solc-js)
Node v8.10.0
Web3.js v1.2.1
truffle(ganache)>

Somebody please guide me how to create an instance of contract in Truffle Console?

Zulfi.

Jun 16, 2020 in Blockchain by Edureka
• 120 points
371 views

1 answer to this question.

0 votes
answered Jun 17, 2020 by Gitika
• 65,870 points

Related Questions In Blockchain

0 votes
1 answer

How to manually create the instance of the contract in truffle?

You can try to do it like ...READ MORE

answered Sep 24, 2018 in Blockchain by slayer
• 29,300 points
894 views
0 votes
1 answer

How to create a contract in truffle?

The command you are using to create ...READ MORE

answered Dec 11, 2018 in Blockchain by Omkar
• 69,130 points
277 views
0 votes
1 answer

How do I send back ethers to the sender of the tokens in a smart contract?

Whenever a smart contract receives ether via ...READ MORE

answered May 30, 2018 in Blockchain by Perry
• 17,100 points
1,694 views
0 votes
1 answer

How to track changes of an object in exonum?

You have to describe each component in ...READ MORE

answered Jul 23, 2018 in Blockchain by slayer
• 29,300 points
154 views
0 votes
1 answer

Truffle tests not running after truffle init

This was a bug. They've fixed it. ...READ MORE

answered Sep 11, 2018 in Blockchain by Christine
• 15,830 points
573 views
0 votes
1 answer
0 votes
1 answer
0 votes
2 answers

how save data from different account using web3.py to smart contract

Hey, @Amal, It will automatically take the address ...READ MORE

answered Jul 27, 2020 in Blockchain by Rajiv
• 8,880 points
417 views
0 votes
1 answer

Can someone tell me how to solve the Hyperledger playground installation issue?

Hey, @Ratul, I would suggest using this command ...READ MORE

answered May 13, 2020 in Blockchain by Gitika
• 65,870 points
252 views