카테고리 없음
[솔리디티][디앱] lottery - 이더리움 GAS 계산
코드코코
2022. 2. 15. 14:01
bet 함수에서 사용하는 수수료가 얼마나 나올지
이더리움에서의 수수료
gas = gasLimit : 일단 트랜잭션 안에서의 가스리밋만 생각해보자
gasPrice
ETH
- 수수료 = gas(21000) * gasPrice(1 gWei == 10**9 wei)
Gas 계산
- 32bytes 새로 저장 == 20000 gas

가나슈로 서버열고
trufflre migrate --reset
truffle console
Lottery.deployed().then(function(instance){lt=instance})
web3.eth.getAccounts()
let bettor = '0xF76c9B7012c0A3870801eaAddB93B6352c8893DB'

lt.bet("0xab",{from:bettor,value:5000000000000000, gas:300000})
