You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: grant_disbursement/README.md
+25-8Lines changed: 25 additions & 8 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -20,31 +20,48 @@ The amount of vested credits is `= (current_block_height - start_block) / (fully
20
20
21
21
## Available methods
22
22
23
-
### create_grant
23
+
### initialize
24
24
25
-
Used to create and start the grant.
25
+
Used to create all of the grants. All grants must be hard coded into the initialize method so they can be funded by a simple credits.aleo/transfer_public
26
26
27
-
The `paleo_amount`should be calculated similarly to a deposit in Pondo to maximize the pAleo received and minimize the slippage.
27
+
The `paleo_amount`is set to 0 initially.
28
28
```
29
29
async transition create_grant(
30
30
public id: u64,
31
31
public credits_amount: u64,
32
-
public paleo_amount: u64,
32
+
public paleo_amount: u128,
33
33
public recipient_rewards_key: address,
34
34
public recipient_principal_key: address,
35
35
public cliff_block: u32,
36
36
public fully_vested_block: u32
37
37
) -> Future
38
38
```
39
39
40
+
### process_grant
41
+
42
+
The actual funder for the grant is expected to transfer credits (using credits.aleo transfer_public or transfer_public_as_signer) directly to the program address.
43
+
44
+
Once the credits are transferred to the program. Anyone can call `process_grant` to deposit the credits into pAleo.
45
+
By default, the pondo deposit is constrained to be within 99.99% of the ideal pAleo minted given a certain credits balance.
46
+
47
+
Calling `process_grant` deposits the credits into the Pondo Protocol, mints the near ideal pAleo and then transfers the pAleo to this program, later to be distributed.
48
+
49
+
```
50
+
async transition process_grant(
51
+
grant_id: u8,
52
+
credits_amount: u64,
53
+
paleo_amount: u128,
54
+
) -> Future
55
+
```
56
+
40
57
### withdraw_rewards
41
58
42
59
Used by the grantee with the `recipient_rewards_key` to claim `pAleo` without touching the principal before the `cliff_block`
43
60
44
61
```
45
62
async transition withdraw_rewards(
46
-
id: u64,
47
-
paleo_amount: u64
63
+
id: u8,
64
+
paleo_amount: u128
48
65
) -> Future
49
66
```
50
67
@@ -54,7 +71,7 @@ Used by the grantee with the `recipient_principal_key` to claim `pAleo` vested p
0 commit comments