Skip to content

Commit 4df0078

Browse files
committed
update doc
1 parent bb60e81 commit 4df0078

File tree

2 files changed

+22
-0
lines changed

2 files changed

+22
-0
lines changed

contracts/pack/Pack.sol

+1
Original file line numberDiff line numberDiff line change
@@ -231,6 +231,7 @@ contract Pack is
231231
emit PackCreated(packId, _recipient, packTotalSupply);
232232
}
233233

234+
/// @dev Add contents to an existing packId.
234235
function addPackContents(
235236
uint256 _packId,
236237
Token[] calldata _contents,

contracts/pack/pack.md

+21
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,27 @@ When creating packs, you can specify the numer of reward units to distribute to
124124

125125
This guarantees that each pack can be opened to retrieve the intended *n* reward units from inside the set of packs.
126126

127+
## Updating packs
128+
129+
You can add more contents to a created pack, up till the first transfer of packs. No addition can be made post that.
130+
131+
```solidity
132+
/// @dev Add contents to an existing packId.
133+
function addPackContents(
134+
uint256 packId,
135+
Token[] calldata contents,
136+
uint256[] calldata numOfRewardUnits,
137+
address recipient
138+
) external
139+
```
140+
141+
| Parameter | Description |
142+
| --- | --- |
143+
| PackId | The identifier of the pack to add contents to. |
144+
| contents | Tokens/assets packed in the set of pack. |
145+
| numOfRewardUnits | Number of reward units for each asset, where each reward unit contains per unit amount of corresponding asset. |
146+
| recipient | The recipient of the new supply added. Should be the same address used during creation of packs. |
147+
127148
## Opening packs
128149

129150
Packs can be opened by owners of packs. A pack owner can open multiple packs at once. ‘Opening a pack’ essentially means burning the pack and receiving the intended *n* number of reward units from inside the set of packs, in exchange.

0 commit comments

Comments
 (0)