gpt4 book ai didi

javascript - 契约(Contract)名称抛出未定义的错误?

转载 作者:行者123 更新时间:2023-11-30 20:48:22 27 4
gpt4 key购买 nike

  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);
};

抵押.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 at deployLoanContract (app.js:22316) at HTMLButtonElement. (app.js:22610) at HTMLButtonElement.dispatch (jquery.min.js:3) at HTMLButtonElement.r.handle (jquery.min.js:3) deployLoanContract @ app.js:22316 (anonymous) @ 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 - 契约(Contract)名称抛出未定义的错误?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/48451795/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com