【问题标题】:contract name throws undefined error?合同名称抛出未定义的错误?
【发布时间】:2018-01-25 20:57:26
【问题描述】:
  Mortgage.new({ from: ownerAccount, gas: defaultGas }).then(
    function(loanInstance) {
        loanContractAddress = loanInstance.address;
        $('#sectionAAddress').html('<i class="fa fa-address-card"></i> ' +

抵押是合约名称

var Mortgage = artifacts.require("./Mortgage.sol");

module.exports = function(deployer) {
  deployer.deploy(Mortgage);
};

Mortgage.sol

pragma solidity ^0.4.4;

contract Mortgage {

  function Mortgage()
  {
    loanApplicant = msg.sender;
    loan.status = STATUS_INITIATED;
    balances[msg.sender] = 100000000;
  }

  /* address of the loan applicant */
  address loanApplicant;

我收到以下 js 错误 界面

Uncaught ReferenceError: Mortgage is not defined 在 deployLoanContract (app.js:22316) 在 HTMLButtonElement。 (app.js:22610) 在 HTMLButtonElement.dispatch (jquery.min.js:3) 在 HTMLButtonElement.r.handle (jquery.min.js:3) deployLoanContract @ app.js:22316 (匿名) @ app.js:22610 dispatch @ jquery.min.js:3 r.handle@jquery.min.js:3

请在下面找到 github url 以检查整个代码 https://github.com/rajivjc/mortgage-blockchain-demo/issues

【问题讨论】:

    标签: javascript blockchain ethereum solidity truffle


    【解决方案1】:

    通过删除构建文件夹解决问题并再次构建

    【讨论】:

    • 我确实有同样的错误并尝试了你的建议,但没有奏效。看起来有些人在 Medium 帖子上也发表了相同的评论。对于这个问题还有什么其他建议吗?
    猜你喜欢
    • 1970-01-01
    • 2022-01-01
    • 1970-01-01
    • 2020-01-05
    • 1970-01-01
    • 2014-07-09
    • 2015-01-28
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多