LoginSignup
1
0

More than 5 years have passed since last update.

truffle console / truffle development におけるMyContract is not definedの対処法

Posted at

状況

truffle console / development において

truffleの.console
truffle(console)>
truffle(console)>MyContract.at("0xabcd...");

と打ちデプロイしたコントラクトを取得しようとした。

原因

そもそもMyContractがコマンド名ではなくて、自分のデプロイをしたコントラクト名に置き換えるという意だった(恥ずかしい。。)

対策

Auction.sol
pragma solidity ^0.4.14;

contract Auction {
------
}
truffleの.console
truffle(console)>
truffle(console)>Auction.deployed();

truffleのドキュメントにあったatだとエラーが出たのでdeployed()にしてます。

備考

以下の環境です
web3: '0.20.5'
truffle: '4.1.3'
solidity: '4.1.14'

参考
http://truffleframework.com/docs/getting_started/console

1
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
0