Skip to content

Commit

Permalink
refund fns: update mint fee calculation
Browse files Browse the repository at this point in the history
  • Loading branch information
calebtuttle committed Aug 1, 2024
1 parent 2675105 commit 9aa5669
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
5 changes: 2 additions & 3 deletions src/services/admin/refund-failed-session.js
Original file line number Diff line number Diff line change
Expand Up @@ -88,9 +88,8 @@ export async function refundFailedSession(req, res) {

const wallet = new ethers.Wallet(process.env.PAYMENTS_PRIVATE_KEY, provider);

// Refund 69.1% of the transaction amount. This approximates the mint cost to
// a fraction of a cent.
const refundAmount = tx.value.mul(691).div(1000);
// Refund 50% of the transaction amount. This approximates the mint cost.
const refundAmount = tx.value.mul(5).div(10);

// Ensure wallet has enough funds to refund
const balance = await wallet.getBalance();
Expand Down
5 changes: 2 additions & 3 deletions src/utils/transactions.js
Original file line number Diff line number Diff line change
Expand Up @@ -146,9 +146,8 @@ async function refundMintFeeOnChain(session, to) {

const wallet = new ethers.Wallet(process.env.PAYMENTS_PRIVATE_KEY, provider);

// Refund 69.1% of the transaction amount. This approximates the mint cost to
// a fraction of a cent.
const refundAmount = tx.value.mul(691).div(1000);
// Refund 50% of the transaction amount. This approximates the mint cost.
const refundAmount = tx.value.mul(5).div(10);

// Ensure wallet has enough funds to refund
const balance = await wallet.getBalance();
Expand Down

0 comments on commit 9aa5669

Please sign in to comment.