Skip to content

Commit

Permalink
fix hardcoded protocol fee (airswap#887)
Browse files Browse the repository at this point in the history
  • Loading branch information
dmosites authored Mar 25, 2024
1 parent 0c75a58 commit 6caa15f
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 10 deletions.
2 changes: 1 addition & 1 deletion src/features/makeOtc/makeOtcActions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ export const createOtcOrder = createAsyncThunk(
signerWallet: signerWallet,
signerToken: params.signerToken,
senderToken: params.senderToken,
protocolFee: "7",
protocolFee: params.protocolFee,
signerAmount,
senderAmount,
chainId: params.chainId,
Expand Down
13 changes: 4 additions & 9 deletions src/features/metadata/metadataSlice.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ export interface MetadataState {

const initialState: MetadataState = {
isFetchingAllTokens: false,
protocolFee: 7,
protocolFee: 0,
tokens: {
all: {},
active: [],
Expand Down Expand Up @@ -88,14 +88,9 @@ export const fetchProtocolFee = createAsyncThunk<
provider: Web3Provider;
chainId: number;
}
>("metadata/fetchProtocolFee", async ({ provider, chainId }) => {
try {
return getProtocolFee(chainId, provider);
} catch {
console.error("Error getting protocol fee from contract, defaulting to 7.");
return 7;
}
});
>("metadata/fetchProtocolFee", async ({ provider, chainId }) =>
getProtocolFee(chainId, provider)
);

export const metadataSlice = createSlice({
name: "metadata",
Expand Down

0 comments on commit 6caa15f

Please sign in to comment.