合约方法
|
|
写程序费用按照gas给挖矿者, gas != Ether
使得函数调用成本相对稳定
背景介绍
- 传统的员工系统
- 整型UINT/INT
(不存在float,不支持) - 地址 Address
- address.balance
- address.transfer(value)
- address.send(value)
- address.call, address.callcode and address.delegatecall
设计
- 薪水将全部基于Ethereum
- uint salary
- address frank
2.
|
|
ETHER unit (只是方便ti数字替代)
- wei
- szabo = 10^12 wei
- find
- ether = 10^18 wei
e.g. 1 wei == 1
时间单位
h2.Block
- block.blockhash
- block.coinbase
- block.difficulty(uint)
- block.
h2.Message
- msg.data
- msg.gas(uint)
- msg.sender(address)
- msg.sig
- msg.value(uint)
如何发放薪水
(函数被动调用)
- 定时器?
- Bob send money to Alice by contract
- How to prevent Bob from not giving Alice the money
- Save money in smart contract, and Alice get money every 30 days
- function addFund
- function calculateRunway
- function hasEnoughFund
- function getPaid