This repository has been archived by the owner on Jul 9, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 465
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
11 changed files
with
61 additions
and
762 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,23 @@ | ||
import { BigNumber } from '@0x/utils'; | ||
import * as ethAbi from 'ethereumjs-abi'; | ||
import * as ethUtil from 'ethereumjs-util'; | ||
|
||
export * from './balance_threshold_wrapper'; | ||
export * from './dutch_auction_test_wrapper'; | ||
|
||
// tslint:disable-next-line:completed-docs | ||
export function encodeDutchAuctionAssetData( | ||
assetData: string, | ||
beginTimeSeconds: BigNumber, | ||
beginAmount: BigNumber, | ||
): string { | ||
const assetDataBuffer = ethUtil.toBuffer(assetData); | ||
const abiEncodedAuctionData = (ethAbi as any).rawEncode( | ||
['uint256', 'uint256'], | ||
[beginTimeSeconds.toString(), beginAmount.toString()], | ||
); | ||
const abiEncodedAuctionDataBuffer = ethUtil.toBuffer(abiEncodedAuctionData); | ||
const dutchAuctionDataBuffer = Buffer.concat([assetDataBuffer, abiEncodedAuctionDataBuffer]); | ||
const dutchAuctionData = ethUtil.bufferToHex(dutchAuctionDataBuffer); | ||
return dutchAuctionData; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
import { DevUtilsContract } from '@0x/contract-wrappers'; | ||
import { NULL_ADDRESS } from '@0x/utils'; | ||
|
||
const fakeProvider = { isEIP1193: true } as any; | ||
export const devUtilsContract = new DevUtilsContract(NULL_ADDRESS, fakeProvider); |
Oops, something went wrong.