Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: params invalid abi type #37

Merged
merged 1 commit into from
May 14, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/young-boxes-visit.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@mangrovedao/mgv": patch
---

Fixed Params not valid ABI type
2 changes: 2 additions & 0 deletions src/builder/kandel/populate.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
import { type ContractFunctionParameters, parseAbi } from 'viem'
import { paramsStruct } from './view.js'

export const populateABI = parseAbi([
paramsStruct,
'function populateFromOffset(uint from, uint to, int baseQuoteTickIndex0, uint _baseQuoteTickOffset, uint firstAskIndex, uint bidGives, uint askGives, Params calldata parameters, uint baseAmount, uint quoteAmount) public payable',
'function populateChunkFromOffset(uint from, uint to, int baseQuoteTickIndex0, uint firstAskIndex, uint bidGives, uint askGives) public payable',
])
Expand Down
5 changes: 4 additions & 1 deletion src/builder/kandel/view.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
import { type ContractFunctionParameters, parseAbi } from 'viem'
import { BA } from '../../lib/enums.js'

export const paramsStruct =
'struct Params { uint32 gasprice; uint24 gasreq; uint32 stepSize; uint32 pricePoints; }' as const

// ba: 0 is bid, 1 is ask
export const viewKandelABI = parseAbi([
paramsStruct,
'function baseQuoteTickOffset() public view returns (uint)',
'struct Params { uint32 gasprice; uint24 gasreq; uint32 stepSize; uint32 pricePoints; }',
'function params() public view returns (Params memory)',
'function offeredVolume(uint8 ba) public view returns (uint volume)',
'function getOffer(uint8 ba, uint index) public view returns (uint offer)',
Expand Down
Loading