Как передать несколько аргументов в Remix? Независимо от того, каким образом я передаю аргументы функции setOrder, я получаю разные ошибки:
SyntaxError: Unexpected token in JSON at position 1
Error: invalid bytes32 value (arg=undefined, type = "string", value = "abc")
Это код:
pragma solidity ^0.4.11;
contract MyContract {
bytes32 public customer;
bytes32 public location;
bytes32 public product;
bytes32 public reorderAmount;
bytes32 public usdLitrePrice;
bytes32 public usdTotalPrice;
bytes32 public timestamp;
function setOrder(bytes32 _customer, bytes32 _location, bytes32 _product, bytes32 _reorderAmount,
bytes32 _usdLitrePrice, bytes32 _usdTotalPrice, bytes32 _timestamp) public {
customer = _customer;
location = _location;
product = _product;
reorderAmount = _reorderAmount;
usdLitrePrice = _usdLitrePrice;
usdTotalPrice = _usdTotalPrice;
timestamp = _timestamp;
}
function getOrder() public constant returns (bytes32, bytes32, bytes32, bytes32, bytes32, bytes32, bytes32) {
return (customer, location, product, reorderAmount, usdLitrePrice, usdTotalPrice, timestamp);
}
}





Вот решение:
Вы не можете использовать пустое пространство после запятой,
Вы не можете использовать ' -> вместо этого используйте "
Вы должны использовать шестнадцатеричный 0x...
Пример:
"0x123","0x123","0x123","0x123","0x123","0x123","0x123"