在以太坊智能合约的IBM 示例中,有以下代码:
personal.unlockAccount(thesponsor,"password");
ss.pledge("Good luck with the run!", {from: thesponsor, value: 10000000, gas: 3000000});
然而,质押函数不是支付修饰符,它只接受一个参数作为参数:
function pledge(bytes32 _message) {
if (msg.value == 0 || complete || refunded) throw;
pledges[numPledges] = Pledge(msg.value, msg.sender, _message);
numPledges++;
}
那么,solidity 是否会自动将 {from: thesponsor, value: 10000000, gas: 3000000} 视为从我的账户转移以太币的 msg 对象?
我只是发现这个功能有点奇怪。如果我写了一个恰好包含关键字“from”和“value”的json对象,我会不小心转移任何资金吗?