0

我有以下问题:

  1. ,bank balance在构造函数中被标记填充为空。

  2. 令牌交易不适sendMoneyToCustomer用于标准功能或标准功能transfer

我使用zeppelin框架和以下示例代码来演示我的问题:

pragma solidity ^0.4.24;

import "browser/Ownable.sol";
import "browser/SafeMath.sol";
import "browser/BasicToken.sol";
import "browser/StandardToken.sol";


contract MyDemo is Ownable, BasicToken, StandardToken {

    using SafeMath for uint;

    address public owner;
    address public bank;
    address public customer;

    uint256 public constant decimals = 18;
    uint multiplier = 10**decimals;

    constructor(address _bank, address _customer) public {
        owner = msg.sender;
        bank = _bank;
        customer = _customer;

        balances[bank].add(10 * decimals);  //Bank gets Money
        allowed[bank][owner] = 1000000;     //Bank approved owner
    }//end constructor


    function sendMoneyToCustomer(uint _value) public returns(bool) {
        balances[bank] = balances[bank].sub(_value);
        balances[customer] = balances[customer].add(_value);
        return true;
    }

}
4

0 回答 0