Skip to content

Commit eeff96f

Browse files
authored
Merge pull request #87 from primitivefinance/develop
Mainnet Release
2 parents 03f27af + 4c86dfd commit eeff96f

File tree

8 files changed

+21
-43
lines changed

8 files changed

+21
-43
lines changed

audits/tob/audit.pdf

933 KB
Binary file not shown.

contracts/PrimitiveManager.sol

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ contract PrimitiveManager is IPrimitiveManager, Multicall, CashManager, SelfPerm
107107
// Mints {delLiquidity} of liquidity tokens
108108
_allocate(recipient, _engine, poolId, delLiquidity);
109109

110-
emit Allocate(msg.sender, _engine, poolId, delLiquidity, delRisky, delStable, fromMargin);
110+
emit Allocate(msg.sender, recipient, _engine, poolId, delLiquidity, delRisky, delStable, fromMargin);
111111

112112
_engine = address(0);
113113
}

contracts/interfaces/IPrimitiveManager.sol

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,14 +42,16 @@ interface IPrimitiveManager is IPrimitiveCreateCallback, IPrimitiveLiquidityCall
4242

4343
/// @notice Emitted when liquidity is allocated
4444
/// @param payer Payer sending liquidity
45+
/// @param recipient Address that receives minted ERC-1155 Primitive liquidity tokens
4546
/// @param engine Primitive Engine receiving liquidity
4647
/// @param poolId Id of the pool receiving liquidity
4748
/// @param delLiquidity Amount of liquidity allocated
4849
/// @param delRisky Amount of risky tokens allocated
4950
/// @param delStable Amount of stable tokens allocated
5051
/// @param fromMargin True if liquidity was paid from margin
5152
event Allocate(
52-
address indexed payer,
53+
address payer,
54+
address indexed recipient,
5355
address indexed engine,
5456
bytes32 indexed poolId,
5557
uint256 delLiquidity,

docusaurus.sqrl

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
11
---
2-
description: {{@if (it.title)}}{{it.title}}{{/if}}
2+
description: {{@if(it.title)}}{{it.title}}{{#else}}{{it.name}}{{/if}}
33

44
---
55

66
{{@if (it.name)}}# {{it.name}}.sol{{/if}}
77

8+
> [Read code on GitHub](https://github.com/primitivefinance/rmm-manager/tree/develop/contracts{{it.path}}/{{it.name}}.sol)
89

910
{{@if (it.notice)}}{{it.notice}}{{/if}}
1011

@@ -21,7 +22,7 @@ description: {{@if (it.title)}}{{it.title}}{{/if}}
2122
## Methods
2223

2324
{{@foreach(it.methods) => key, val}}
24-
### {{key}}
25+
### {{key.split('(')[0]}}
2526

2627

2728
{{@if (val.notice)}}{{val.notice}}{{/if}}
@@ -47,8 +48,7 @@ description: {{@if (it.title)}}{{it.title}}{{/if}}
4748
| Name | Type | Description |
4849
|---|---|---|
4950
{{@foreach(val.inputs) => key, val}}
50-
| {{key}} | {{val.type}} | {{val.description}}
51-
51+
| {{key}} | {{val.type}} | {{val.description}} |
5252
{{/foreach}}
5353
{{/if}}
5454

@@ -58,8 +58,7 @@ description: {{@if (it.title)}}{{it.title}}{{/if}}
5858
| Name | Type | Description |
5959
|---|---|---|
6060
{{@foreach(val.outputs) => key, val}}
61-
| {{key}} | {{val.type}} | {{val.description}}
62-
61+
| {{key}} | {{val.type}} | {{val.description}} |
6362
{{/foreach}}
6463

6564
{{/if}}

hardhat.config.ts

Lines changed: 4 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import { HardhatUserConfig } from 'hardhat/types'
12
import '@typechain/hardhat'
23
import '@nomiclabs/hardhat-ethers'
34
import '@nomiclabs/hardhat-waffle'
@@ -43,35 +44,11 @@ function createTestnetConfig(network: keyof typeof chainIds): NetworkUserConfig
4344
}
4445
}
4546

46-
const config = {
47+
const config: HardhatUserConfig = {
4748
dodoc: {
4849
runOnCompile: false,
49-
include: [
50-
'PositionRenderer',
51-
'PrimitiveManager',
52-
'CashManager',
53-
'ERC1155Permit',
54-
'ManagerBase',
55-
'MarginManager',
56-
'Multicall',
57-
'PositionManager',
58-
'Reentrancy',
59-
'SelfPermit',
60-
'SwapManager',
61-
'ICashManager',
62-
'IERC1155Permit',
63-
'IManagerBase',
64-
'IMarginManager',
65-
'IMulticall',
66-
'IPositionRenderer',
67-
'IPrimitiveManager',
68-
'ISelfPermit',
69-
'ISwapManager',
70-
'EngineAddress',
71-
'HexStrings',
72-
'Margin',
73-
'TransferHelper',
74-
],
50+
include: ['contracts'],
51+
exclude: ['test', 'libraries'],
7552
templatePath: './docusaurus.sqrl',
7653
},
7754
networks: {

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@
4747
"@nomiclabs/hardhat-ethers": "^2.0.2",
4848
"@nomiclabs/hardhat-etherscan": "^3.0.0",
4949
"@nomiclabs/hardhat-waffle": "^2.0.1",
50-
"@primitivefi/hardhat-dodoc": "^0.1.3",
50+
"@primitivefi/hardhat-dodoc": "^0.2.3",
5151
"@primitivefi/rmm-math": "^2.0.0-rc.1",
5252
"@typechain/ethers-v5": "^7.1.0",
5353
"@typechain/hardhat": "^2.2.0",

test/unit/primitiveManager/allocate.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ runTest('allocate', function () {
115115
)
116116
)
117117
.to.emit(this.manager, 'Allocate')
118-
.withArgs(this.deployer.address, this.engine.address, poolId, delLiquidity.raw, delRisky.raw, delStable.raw, true)
118+
.withArgs(this.deployer.address, recipient, this.engine.address, poolId, delLiquidity.raw, delRisky.raw, delStable.raw, true)
119119
})
120120

121121
it('does not reduces the balances of the sender', async function () {
@@ -221,7 +221,7 @@ runTest('allocate', function () {
221221
)
222222
)
223223
.to.emit(this.manager, 'Allocate')
224-
.withArgs(this.deployer.address, this.engine.address, poolId, delLiquidity.raw, delRisky.raw, delStable.raw, false)
224+
.withArgs(this.deployer.address, recipient, this.engine.address, poolId, delLiquidity.raw, delRisky.raw, delStable.raw, false)
225225
})
226226
})
227227

@@ -343,7 +343,7 @@ runTest('allocate', function () {
343343
)
344344
)
345345
.to.emit(this.manager, 'Allocate')
346-
.withArgs(this.deployer.address, engine.address, poolId, delLiquidity.raw, delRisky.raw, delStable.raw, false)
346+
.withArgs(this.deployer.address, recipient, engine.address, poolId, delLiquidity.raw, delRisky.raw, delStable.raw, false)
347347
})
348348
})
349349
})

yarn.lock

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -731,10 +731,10 @@
731731
resolved "https://registry.yarnpkg.com/@openzeppelin/contracts/-/contracts-4.5.0.tgz#3fd75d57de172b3743cdfc1206883f56430409cc"
732732
integrity sha512-fdkzKPYMjrRiPK6K4y64e6GzULR7R7RwxSigHS8DDp7aWDeoReqsQI+cxHV1UuhAqX69L1lAaWDxenfP+xiqzA==
733733

734-
"@primitivefi/hardhat-dodoc@^0.1.3":
735-
version "0.1.3"
736-
resolved "https://registry.yarnpkg.com/@primitivefi/hardhat-dodoc/-/hardhat-dodoc-0.1.3.tgz#338ecff24b93d3b43fa35a98909f6840af86c27c"
737-
integrity sha512-IM2rwyk9SHxnifHnoCKmB1K1su/d1BvF5C0zspCWH8rVrrNpS1NzLTjisDNJmbM69/cWcEX0vfk449LuTsQVaw==
734+
"@primitivefi/hardhat-dodoc@^0.2.3":
735+
version "0.2.3"
736+
resolved "https://registry.yarnpkg.com/@primitivefi/hardhat-dodoc/-/hardhat-dodoc-0.2.3.tgz#76aebbfa70de2d6454af29e166b1430583b54c5c"
737+
integrity sha512-ver9uHa79LTDTeebOKZ/eOVRL/FP1k0s0x/5Bo/8ZaDdLWFVClKqZyZYVjjW4CJqTPCt8uU9b9p71P2vzH4O9A==
738738
dependencies:
739739
squirrelly "^8.0.8"
740740

0 commit comments

Comments
 (0)