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 in Blockchain by Edureka
• 120 points
40 views

1 answer to this question.

0 votes
answered Jun 17 by Gitika
• 32,770 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,270 points
275 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,040 points
73 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,090 points
928 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,270 points
93 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,810 points
346 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 6 days ago in Blockchain by Rajiv
• 300 points
49 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 in Blockchain by Gitika
• 32,770 points
59 views