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: pages/allo/flow-of-funds.mdx
+33-57
Original file line number
Diff line number
Diff line change
@@ -2,16 +2,10 @@ import Image from 'next/image'
2
2
3
3
# Flow of Funds
4
4
5
-
While there is a lot of nuance in how pools get allocated by Allocation
6
-
Strategies, generally speaking there are four steps in the life cycle of a pool.
7
-
Each step is handled by the Allo core contract (`Allo.sol`), though some of
8
-
these methods are implemented by the allocation strategy attached to a pool.
9
-
10
-
A pool's allocation strategy is what determines how funds are both allocated and
11
-
distributed. But to make implementing consistent front ends on Allo easier,
12
-
allocation strategies assume that they are being called by `Allo.sol`, which
13
-
implements an `allocate()` and `distribute()` method
14
-
5
+
While there is nuance in how pools get allocated by Strategies, there are
6
+
generally four steps in the life cycle of a pool.
7
+
Each step is invoked on [`Allo.sol`](/allo), which calls the relevent
8
+
method on the strategy.
15
9
<divclassName="my-10">
16
10
<Image
17
11
src="/Flow of funds - 1.png"
@@ -25,79 +19,61 @@ implements an `allocate()` and `distribute()` method
25
19
26
20
The Allo core contract has two methods for creating a pool:
27
21
28
-
1. The `createPool` method
29
-
2. The `createPoolWithCustomStrategy` method
30
-
31
-
While there are some differences between the two methods, they both create
32
-
a pool for a given Profile in the Registry, and associate an allocation strategy
33
-
to it. You can read more about the differences between the two and which to use
34
-
in [Working with Pools](/allo/working-with-pools).
22
+
1. The [`createPool`](https://github.com/allo-protocol/allo-v2.1/blob/dev/contracts/core/Allo.md#create-pool) method
23
+
2. The [`createPoolWithCustomStrategy`](https://github.com/allo-protocol/allo-v2.1/blob/dev/contracts/core/Allo.md#create-a-pool-with-custom-strategy) method
35
24
36
-
Finally, you can create and fund the pool simultaneously through both methods or
37
-
you can create the pool and then fund it separately with the `fundPool` method
38
-
on `Allo.sol`.
25
+
This first method for creating a pool creates a new pool by
26
+
cloning an already deployed one. This makes it simple to make use of existing
27
+
on-chain strategies. If you're using a custom or newly developed strategy, then you
28
+
would deploy it to chain, and use the second method (`createPoolWithCustomStrategy`).
39
29
40
30
Some things to note:
41
31
- Pools must be created by a Profile from the Registry
42
32
- Pools can be created with an initial balance of 0 and funded later
43
-
-Technically, anyone can fund a pool
33
+
-By default, anyone can fund a pool
44
34
45
35
## Funding a Pool
46
36
47
37
A pool can be funded when it is created and/or it can be funded afterwards. You
48
-
can do either or you can do both. If funding the pool after creating it, then you'll use the `fundPool` method on `Allo.sol`.
38
+
can do either or you can do both. If funding the pool after creating it, then use
39
+
* The [**`fundPool`**](https://github.com/allo-protocol/allo-v2.1/blob/dev/contracts/core/Allo.md#fund-pool)
40
+
method
49
41
50
-
Pools can also be funded with either native Ether or an ERC20 token. Note though
42
+
Pools can be funded with either native Ether or an ERC20 token. Note though
51
43
that a pool can only distribute one token, which is determined when the pool is
52
44
created. Trying to call `fundPool` with a token other than the one used when the
53
-
pool was created will cause the method to revert with an error. Pools should
54
-
always be funded using the `fundPool` method and you should never transfer funds
55
-
directly to `Allo.sol`
45
+
pool was created will cause the method to revert with an error. **Pools should
46
+
always be funded using the `fundPool` method and **you should never transfer funds
47
+
directly to `Allo.sol`**
56
48
57
49
Once a pool has been funded, there is no way to withdraw funds from the pool
58
-
other than to distribute them through the allocation strategy.
50
+
bypassing the terms defined by the strategy. Strategies will have a
The Allo core contract (`Allo.sol`) plays a couple of key roles. This is where
4
-
you create and fund pools, assign them an allocation strategy, and manage them.
5
-
`Allo.sol` is primarily how you'll interact with an allocation strategy too.
3
+
The Allo core contract ([`Allo.sol`](https://github.com/allo-protocol/allo-v2.1/blob/dev/contracts/core/Allo.sol))
4
+
is the command center for pools. This is where pools are created and funded, assigned
5
+
an allocation strategy, and more. It is mostly through `Allo.sol`you will interact
6
+
with a strategy too.
6
7
7
-
If you're building a front end application on top of the protocol, you should
8
-
only have to integrate with the core contract.
8
+
There is a wealth of sequence diagrams and developer-oriented information in
9
+
the bundled [**Allo.md**](https://github.com/allo-protocol/allo-v2.1/blob/dev/contracts/core/Allo.md).
9
10
10
11
## Creating a Pool
11
12
12
13
One of the key responsibilities of the Allo core contract is to create and
13
-
manage pools of tokens that can be allocated using a strategy. Allo provides two
14
-
ways of doing this:
14
+
manage pools. Allo provides two ways of doing this:
15
15
16
-
1. The `createPool` method
17
-
2. The `createPoolWithCustomStrategy` method
16
+
1. The [`createPool`](https://github.com/allo-protocol/allo-v2.1/blob/dev/contracts/core/Allo.md#create-pool) method
17
+
2. The [`createPoolWithCustomStrategy`](https://github.com/allo-protocol/allo-v2.1/blob/dev/contracts/core/Allo.md#create-a-pool-with-custom-strategy) method
18
18
19
-
The first method for creating a pool (`createPool`) creates a new pool by
20
-
cloning a strategy provided as part of Allo. This saves gas and makes it easier
21
-
to deploy a pool from the front end. If you're using your own strategy, then
22
-
you'll use the second method (`createPoolWithCustomStrategy`).
19
+
This first method for creating a pool creates a new pool by
20
+
cloning an already deployed one. This makes it simple to make use of existing
21
+
on-chain strategies. If you're using a custom or newly developed strategy, then you
22
+
would deploy it to chain, and use the second method (`createPoolWithCustomStrategy`).
23
23
24
-
Further reading:
25
-
26
-
*[Working with Pools](/allo/working-with-pools)
27
-
*[Building on Allo](/allo/building-on-allo)
24
+
Once created, a pool and a specific strategy deployment are permanently linked. A strategy
25
+
cannot be used for a different pool later, but they are easily cloned. It is best to
26
+
only create a pool once you are certain the choice of strategy is final.
28
27
29
28
## Adding and removing funds
30
29
31
-
At some point, you need to fund the pool before you can start allocating it. You
32
-
can do this at pool creation, by sending tokens or Eth when you call
33
-
`createPool` or `createPoolWithCustomStrategy`. Or you can do this after the
34
-
fact by calling the `fundPool` method on Allo.
35
-
36
-
If you're building an application on Allo or writing an allocation strategy,
37
-
this is a useful thing to consider. Depending on what you're building and what
38
-
you want to solve for, it might not be the case that the funds someone want to
39
-
allocate are secured when they create the pool - they could need to fundraise
40
-
for a while first. That's why we've separated creating and funding a pool. Your
41
-
allocation strategy and/or front end application should take this into account
42
-
too.
30
+
The pool will need funds before you can start allocating them. This
31
+
can be done:
32
+
1. At pool creation by sending tokens or ETH when you call
33
+
`createPool`/`createPoolWithCustomStrategy`
34
+
2. After the fact by calling [**`fundPool`**](https://github.com/allo-protocol/allo-v2.1/blob/dev/contracts/core/Allo.md#fund-pool)
43
35
44
-
Also note that once a pool is funded, the only way to distribute those funds is
36
+
Note that once a pool is funded, the only way to distribute those funds is
45
37
through the allocation strategy. You cannot change which allocation strategy is
46
38
tied to a particular pool.
47
39
48
-
Further reading:
49
-
50
-
*[Working with Pools](/allo/working-with-pools)
51
-
*[Building on Allo](/allo/building-on-allo)
52
-
53
40
## Managing a Pool
54
41
55
-
Allo creates two roles for every pool:
56
-
57
-
1. The pool admin
58
-
2. The pool managers
59
-
60
-
The admin will be the value of `msg.sender` when `createPool` or
61
-
`createPoolWithCustomStrategy` is called (i.e. the address creating the pool is
62
-
the admin).
63
-
64
-
When a pool is created, you can pass a list of addresses that will be given the
65
-
manager role. There are also two methods for managing the pool managers:
42
+
Allo creates two roles to help manage every pool:
66
43
67
-
1.`addPoolManager`, for adding an address as a pool manager
68
-
2.`removePoolManager`, for removing an address as a pool manager
44
+
* Pool admin - the address that created a pool
45
+
* Pool managers - optional list of addresses
69
46
70
-
Only the pool admin can call `addPoolManager` or `removePoolManager`.
47
+
Managers and admin (may) have authority to update a pool's metadata, and have say in
48
+
determining fund allocation (i.e. approving or rejecting applications). The specifics
49
+
will vary depending on the strategy.
50
+
Pool managers can also be added or removed later, but only by the Admin:
71
51
72
-
The reason for this role system is two fold:
73
-
74
-
1. To determine which addresses can update data about the pool
75
-
2. Optionally, for use in an allocation strategy when determining which addresses can allocate from a pool
0 commit comments