Skip to content

Commit

Permalink
Merge pull request #58 from consenlabs/feature/remove_signer_address_…
Browse files Browse the repository at this point in the history
…from_forwarding_orders

Fix: removing signer address while forwarding orders to market makers
  • Loading branch information
BenjaminLu authored Sep 1, 2023
2 parents da81523 + 74b7a7a commit 4d93505
Show file tree
Hide file tree
Showing 6 changed files with 9 additions and 6 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ Program setup,
please set the SIGNING_URL to your service endpoint. the mmsk would post every unsigned PMM/RFQV1/RFQV2 orders to your service. Remember to set the WALLET_ADDRESS as well. An example RFQV1 request is shown below:
```
{
protocol: 'RFQV1',
rfqOrder: {
takerAddr: '0x87fca7135c1c54876a62dc4922da3ce45f38debf',
makerAddr: '0x86B9F429C3Ef44c599EB560Eb531A0E3f2E36f64',
Expand All @@ -42,7 +43,6 @@ Program setup,
salt: '54987026777386128963216107663301166813737035846370728350988439404382800511006'
},
userAddr: '0x87fca7135c1c54876a62dc4922da3ce45f38debf',
signer: '0xb5419119e04498C3eC43A9468D6480aF0DAE3A0c',
chainId: 1,
rfqAddr: '0xfD6C2d2499b1331101726A8AC68CCc9Da3fAB54F'
}
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@consenlabs/tokenlon-mmsk",
"version": "5.3.0",
"version": "5.3.1",
"description": "Tokenlon market maker server kit",
"author": "imToken PTE. LTD.",
"license": "MIT",
Expand Down
2 changes: 1 addition & 1 deletion src/handler/version.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
export const VERSION = '5.3.0'
export const VERSION = '5.3.1'

export const version = (ctx) => {
ctx.body = {
Expand Down
3 changes: 2 additions & 1 deletion src/signer/pmmv5.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import * as ethUtils from 'ethereumjs-util'
import { utils, Wallet } from 'ethers'
import axios from 'axios'
import { BigNumber, orderBNToString } from '../utils'
import { Protocol } from '../types'

const EIP712_ORDER_SCHEMA = {
name: 'Order',
Expand Down Expand Up @@ -160,12 +161,12 @@ export const buildSignedOrder = async (
: await signByMMPSigner(orderSignDigest, userAddr, feeFactor, signer)
} else {
makerWalletSignature = await forwardUnsignedOrder(signingUrl, {
protocol: Protocol.PMMV5,
pmmOrder: o,
feeFactor: feeFactor,
orderHash: orderHash,
orderSignDigest: orderSignDigest,
userAddr: userAddr,
signer: signer.address,
chainId: chainId,
pmmAddr: pmm,
})
Expand Down
3 changes: 2 additions & 1 deletion src/signer/rfqv1.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import { RFQOrder, WalletType } from './types'
import * as ethUtils from 'ethereumjs-util'
import { SignatureType } from './types'
import axios from 'axios'
import { Protocol } from '../types'

// spec of RFQV1
// - taker address point to userAddr
Expand Down Expand Up @@ -188,9 +189,9 @@ export const buildSignedOrder = async (
}
} else {
makerWalletSignature = await forwardUnsignedOrder(signingUrl, {
protocol: Protocol.RFQV1,
rfqOrder: rfqOrder,
userAddr: userAddr,
signer: signer.address,
chainId: chainId,
rfqAddr: rfqAddr,
})
Expand Down
3 changes: 2 additions & 1 deletion src/signer/rfqv2.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import * as ethUtils from 'ethereumjs-util'
import axios from 'axios'
import { generatePseudoRandomSalt } from '0x-v2-order-utils'
import { signWithUserAndFee } from './pmmv5'
import { Protocol } from '../types'

// spec of RFQV2
// - taker address point to userAddr
Expand Down Expand Up @@ -175,9 +176,9 @@ export const buildSignedOrder = async (
}
} else {
makerWalletSignature = await forwardUnsignedOrder(signingUrl, {
protocol: Protocol.RFQV2,
rfqOrder: rfqOrder,
userAddr: userAddr,
signer: signer.address,
chainId: chainId,
rfqAddr: rfqAddr,
})
Expand Down

0 comments on commit 4d93505

Please sign in to comment.