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
{{ message }}
This repository has been archived by the owner on Jul 9, 2021. It is now read-only.
Encoding some data with DutchAuctionWrapper.encodeDutchAuctionAssetData and then decoding it with DutchAuctionWrapper.decodeDutchAuctionAssetData should give back the same arguments that were used during the encoding.
Current Behavior
const data = DutchAuctionWrapper.encodeDutchAuctionAssetData(wethAssetData, new BigNumber('1557853498'), new BigNumber('1000000000000000000'))
// data is '0xf47261b00000000000000000000000000b1ba0af832d7c05fd64161e0db78e85978e8082000000000000000000000000000000000000000000000000000000005cdaf53a0000000000000000000000000000000000000000000000000de0b6b3a7640000'
const decoded = DutchAuctionWrapper.decodeDutchAuctionData(data)
// decoded is {
// assetData: { assetProxyId: '0xf47261b0', tokenAddress: '0x0b1ba0af832d7c05fd64161e0db78e85978e8082' },
// beginTimeSeconds: 91662660760,
// beginAmount: 4722366482869645213696
// }
Notice that beginTimeSeconds is 1557853498 (the original argument) interpreted as hex:
Expected Behavior
Encoding some data with
DutchAuctionWrapper.encodeDutchAuctionAssetData
and then decoding it withDutchAuctionWrapper.decodeDutchAuctionAssetData
should give back the same arguments that were used during the encoding.Current Behavior
Notice that
beginTimeSeconds
is1557853498
(the original argument) interpreted as hex:The same happens with
beginAmount
.Possible Solution
I think the problem might be here:
0x-monorepo/packages/contract-wrappers/src/contract_wrappers/dutch_auction_wrapper.ts
Lines 74 to 75 in 418d033
After getting the decoded data, a
BigNumber
is created by prepending0x
to it.Your Environment
0x.js
The text was updated successfully, but these errors were encountered: