我在这里有此功能
function reinvest() onlyDivis public { address _customerAddress = msg.sender; uint256 _dividends = myDividends(false); payoutsTo_[_customerAddress] += (int256) (_dividends * magnitude); _dividends += referralBalance_[_customerAddress]; referralBalance_[_customerAddress] = 0; uint256 _tokens = purchaseTokens(0x0, _customerAddress, _dividends); emit onReinvestment(_customerAddress, _dividends, _tokens);
我可以从我的UI调用再投资函数,但是如何使用emit(函数),以便可以使用它来更新UI上的信息?
我在此具有此功能仅对函数reinvest()起作用。Divis public {address _customerAddress = msg.sender; uint256 _dividends = myDividends(false); payoutsTo _ [_ customerAddress] ...
发出事件实际上是以后搜索某些东西的一种很好的方法。