Skip to content

Commit

Permalink
feat(allocate-recipient): adds recipient to allocate so its actually …
Browse files Browse the repository at this point in the history
…used
  • Loading branch information
Alexangelj committed Feb 2, 2022
1 parent 886d3d6 commit 4fec0c5
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 7 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
},
"dependencies": {
"@primitivefi/rmm-core": "^1.0.0-rc.2",
"@primitivefi/rmm-manager": "^1.0.0-rc.2",
"@primitivefi/rmm-manager": "^1.0.0-rc.3",
"@primitivefi/rmm-math": "^2.0.0-rc.1",
"@uniswap/sdk-core": "^3.0.1",
"shelljs": "0.8.5",
Expand Down
1 change: 1 addition & 0 deletions src/peripheryManager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -410,6 +410,7 @@ export abstract class PeripheryManager extends SelfPermit {
} else {
calldatas.push(
PeripheryManager.INTERFACE.encodeFunctionData('allocate', [
recipient,
pool.poolId,
pool.risky.address,
pool.stable.address,
Expand Down
21 changes: 19 additions & 2 deletions test/PeripheryManager.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -325,7 +325,15 @@ describe('Periphery Manager', function() {
delLiquidity,
slippageTolerance
})
const data = [pool.poolId, pool.risky.address, pool.stable.address, delRisky.raw, delStable.raw, fromMargin]
const data = [
recipient,
pool.poolId,
pool.risky.address,
pool.stable.address,
delRisky.raw,
delStable.raw,
fromMargin
]
const decoded = decode('allocate', calldata)
data.forEach((item, i) => expect(item.toString()).toStrictEqual(decoded[i].toString()))
expect(value).toBe('0x00')
Expand All @@ -346,7 +354,15 @@ describe('Periphery Manager', function() {
delLiquidity,
slippageTolerance: parsePercentage(0)
})
const data = [pool.poolId, pool.risky.address, pool.stable.address, delRisky.raw, delStable.raw, fromMargin]
const data = [
recipient,
pool.poolId,
pool.risky.address,
pool.stable.address,
delRisky.raw,
delStable.raw,
fromMargin
]
const decoded = decode('allocate', calldata)
data.forEach((item, i) => expect(item.toString()).toStrictEqual(decoded[i].toString()))
expect(value).toBe('0x00')
Expand All @@ -371,6 +387,7 @@ describe('Periphery Manager', function() {
})

const allocateData = [
recipient,
wethPool.poolId,
wethPool.risky.address,
wethPool.stable.address,
Expand Down
8 changes: 4 additions & 4 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1745,10 +1745,10 @@
resolved "https://registry.yarnpkg.com/@primitivefi/rmm-core/-/rmm-core-1.0.0-rc.2.tgz#b30741108d1bc1fe52dd1db32b449cdf7919ffd6"
integrity sha512-dX58g1WcKfm+nWNZtWtPPMJp1GYe6Py0PxDbc7tvcTEXTYgf2/FHYUjEO9KEKqrFKgPLHh3B2NQrCIiXvHE/DQ==

"@primitivefi/rmm-manager@^1.0.0-rc.2":
version "1.0.0-rc.2"
resolved "https://registry.yarnpkg.com/@primitivefi/rmm-manager/-/rmm-manager-1.0.0-rc.2.tgz#5740eceafdb17fa7f24b835eb43afaf1e9b3eb95"
integrity sha512-hrWxaTE7Zgh29MR2DSjxJcjWC4xRQygg4YtHmvC4rMVwGw3VGRjsXWg3qITUsor8xza0WYMQPFGohYmGT/tKGQ==
"@primitivefi/rmm-manager@^1.0.0-rc.3":
version "1.0.0-rc.3"
resolved "https://registry.yarnpkg.com/@primitivefi/rmm-manager/-/rmm-manager-1.0.0-rc.3.tgz#481d6e1dd6a0edad8d163a7c2ae4271e201c9b84"
integrity sha512-orXVdIF9wdvoRl67Os8Goz0OV9cWV87a7EsV/izb84V+yPVWDrNTQcbQbxDEl10Zl+NqX0FbOSy8TLj8HnySdw==
dependencies:
"@openzeppelin/contracts" "^4.1.0"
"@primitivefi/rmm-core" "^1.0.0-rc.2"
Expand Down

0 comments on commit 4fec0c5

Please sign in to comment.