Skip to content

Commit

Permalink
Merge pull request #27 from terraswap/fix/limit-BASE-fee-applied-pair
Browse files Browse the repository at this point in the history
Limit BASE token fee applied pair
  • Loading branch information
jbamlee authored Feb 21, 2024
2 parents 940997b + 2315856 commit d5b2a85
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
1 change: 1 addition & 0 deletions src/collector/log-finder/nonnativeTransferLF.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ function createClassicLogFinder(height?: number) {

const oddTokenHandlingInfo = ClassicOddTokenHandlerMap.get(transformed.assets.token)
if (
oddTokenHandlingInfo?.pair(transformed.addresses.to) &&
oddTokenHandlingInfo?.action(match?.find(m => m.key === "action")?.value) &&
height && height >= oddTokenHandlingInfo?.appliedHeight
) {
Expand Down
12 changes: 9 additions & 3 deletions src/lib/terraswap/classic.consts.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,19 @@ export const ClassicReceiverFeeAppliedPairSet: Set<string> = new Set([
interface OddTokenHandlingInfo {
feeRate: string
appliedHeight: number
action: (a: string)=> boolean
action: (a: string) => boolean
pair: (p: string) => boolean
}

const oddTokenAppliedPair: Set<string> = new Set([
"terra1ggjadsdn285f4ae9wykle5lnawna7gdk32g6dfgpev8j0hx5jkpsc7u4gn", // uluna - BASE
])

const CLASSIC_BASE_TOKEN = "terra1uewxz67jhhhs2tj97pfm2egtk7zqxuhenm4y4m"
const APPLIED_HEIGHT = 16746830
export const ClassicOddTokenHandlerMap: Map<string, OddTokenHandlingInfo> = new Map([[CLASSIC_BASE_TOKEN, {
feeRate: "0.048",
appliedHeight: APPLIED_HEIGHT,
action: (a: string) => a === "send"
}]])
action: (a: string) => a === "send",
pair: (p: string) => oddTokenAppliedPair.has(p)
}]])

0 comments on commit d5b2a85

Please sign in to comment.