-
Notifications
You must be signed in to change notification settings - Fork 78
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
1 parent
cc0580c
commit af51388
Showing
1 changed file
with
26 additions
and
18 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,26 +1,34 @@ | ||
import { ethers } from "ethers"; | ||
|
||
export type Bytes = string; | ||
export type Bytes32 = string; | ||
export type uint80 = string; | ||
export type uint80 = number; | ||
|
||
export type Blueprint = { | ||
publisher: string; | ||
data: Bytes; | ||
operatorPasteInstrs: Bytes32[]; | ||
maxNonce: number; | ||
startTime: number; | ||
endTime: number; | ||
} | ||
|
||
publisher: string; | ||
data: ethers.Bytes; | ||
operatorPasteInstrs?: ethers.Bytes; | ||
maxNonce: ethers.BigNumber; | ||
startTime: ethers.BigNumber; | ||
endTime: ethers.BigNumber; | ||
}; | ||
|
||
export type Requisition = { | ||
blueprint: Blueprint; | ||
blueprintHash: Bytes32; | ||
signature: Bytes; | ||
} | ||
blueprint: Blueprint; | ||
blueprintHash: ethers.Bytes; | ||
signature: ethers.Bytes; | ||
}; | ||
|
||
export type Draft = { | ||
advFarmCalls: AdvancedFarmCall[]; | ||
operatorPasteInstrs: OperatorPasteInstr[]; | ||
}; | ||
|
||
export type AdvancedFarmCall = { | ||
callData: ethers.Bytes; | ||
clipboard: ethers.Bytes; | ||
}; | ||
|
||
function toBytes32(data: number) { | ||
return ethers.utils.hexlify(ethers.utils.zeroPad(data.toString(), 32)); | ||
} | ||
export type OperatorPasteInstr = { | ||
copyByteIndex: uint80; | ||
pasteCallIndex: uint80; | ||
pasteByteIndex: uint80; | ||
}; |