FeesDistribution
Implements
Serializable
Table of contents
Constructors
Properties
Methods
Constructors
constructor
• new FeesDistribution(total?, protocol?): FeesDistribution
Parameters
| Name | Type | Default value | Description |
|---|---|---|---|
total | u256 | ZERO | The total amount of fees |
protocol | u256 | ZERO | The amount of fees reserved for protocol |
Returns
Defined in
assembly/structs/FeesDistribution.ts:11
Properties
protocol
• protocol: u256 = ZERO
The amount of fees reserved for protocol
Defined in
assembly/structs/FeesDistribution.ts:13
total
• total: u256 = ZERO
The total amount of fees
Defined in
assembly/structs/FeesDistribution.ts:12
Methods
deserialize
▸ deserialize(data, offset): Result<i32>
Parameters
| Name | Type |
|---|---|
data | StaticArray<u8> |
offset | i32 |
Returns
Result<i32>
Implementation of
Serializable.deserialize
Defined in
assembly/structs/FeesDistribution.ts:37
getTokenPerShare
▸ getTokenPerShare(totalSupply): u256
Calculate the tokenPerShare when fees are added
Parameters
| Name | Type | Description |
|---|---|---|
totalSupply | u256 | the total supply of a specific bin |
Returns
u256
Defined in
assembly/structs/FeesDistribution.ts:21
serialize
▸ serialize(): StaticArray<u8>
Returns
StaticArray<u8>
Implementation of
Serializable.serialize