Transaction
82AE37D25797ED…429166A51396
Block 652,371 · index 0 · RPC
Summary
- Hash
- 82AE37D25797ED6047A20187EF3C9C6C702B2E3EAA9B60583B4F429166A51396
- Block
- 652,371
- Size
- 1554 bytes
- Gas used
- 7,282,375 / 10,000,000
- Fee
- 10000 ugnot
- Status
- success
Messages
- Attached funds
- 2000000 ugnot
Arguments · 7
- #1vesting
- #2gnomod.toml
- #3module = "gno.land/p/samcrew/launchpad/vesting/v1" gno = "0.9"
- #4vesting.gno
- #5// Package vesting computes cliff-then-linear token release. package vesting import sm "gno.land/p/samcrew/launchpad/safemath/v1" type Schedule struct { Total int64 Start int64 // unix seconds Cliff int64 // seconds after Start before anything vests Duration int64 // seconds after Start when everything has vested } func (s Schedule) Validate() { if s.Total <= 0 || s.Start < 0 || s.Duration <= 0 || s.Cliff < 0 || s.Cliff > s.Duration { panic("launchpad/vesting: invalid schedule") } sm.Add(s.Start, s.Duration) } func (s Schedule) VestedAt(now int64) int64 { s.Validate() if now < sm.Add(s.Start, s.Cliff) { return 0 } elapsed := now - s.Start if elapsed >= s.Duration { return s.Total } return sm.MulDiv(s.Total, elapsed, s.Duration) } func (s Schedule) Releasable(now, released int64) int64 { return sm.Sub(s.VestedAt(now), released) }
- #6/gno.MemPackageType
- #7 MPUserAll
Result log
msg:0,success:true,log:,events:[]