Ethereum 在IBM示例中,以太网是如何发送到smart contract的

Ethereum 在IBM示例中,以太网是如何发送到smart contract的,ethereum,solidity,Ethereum,Solidity,我正在阅读有关Smart赞助人的文章,其中有以下代码: 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 || ref

我正在阅读有关Smart赞助人的文章,其中有以下代码:

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

struct Pledge {
  uint amount;
  address eth_address;
  bytes32 message;
}
我正在寻找“发送”或“传输”功能。但是我找不到。因此,我很困惑赞助商是如何将以太发送到智能合约的

更新:


发送者是如何发送以太的?我期待的是.transfer(uint256金额)或.send(uint256金额)之类的内容。但似乎没有这样的函数调用

它们在魔法变量中。函数在以下行中使用此变量:

pledges[numPledges] = Pledge(msg.value, msg.sender, _message);

但是发送者是如何发送以太的呢?我期待的是.transfer(uint256金额)或.send(uint256金额)之类的内容。但似乎没有这样的函数调用?您的默认帐户用于此。