Skip to content

Commit

Permalink
Merge pull request #2291 from DefiLlama/creator-bid
Browse files Browse the repository at this point in the history
add creator-bid
  • Loading branch information
dtmkeng authored Jan 8, 2025
2 parents c6fab3f + 264baba commit 4882b8b
Showing 1 changed file with 34 additions and 0 deletions.
34 changes: 34 additions & 0 deletions fees/creator-bid.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
import { FetchOptions, SimpleAdapter } from "../adapters/types";
import { CHAIN } from "../helpers/chains";

const contract = '0xe794f7eb7e644eb49056133373fb9b1ea39f22ad'
const payment_event = 'event Payment(address indexed from, uint256 value)'

const fetchFees = async (options: FetchOptions) => {
const dailyFees = options.createBalances();
const logs = await options.getLogs({
target: contract,
eventAbi: payment_event,
});
logs.map((log: any) => {
dailyFees.addGasToken(log.value);
});

return {
dailyFees,
dailyRevenue: dailyFees,
};
}


const adapter: SimpleAdapter = {
version: 2,
adapter: {
[CHAIN.BASE]: {
fetch: fetchFees,
start: '2024-09-09',
},
},
}

export default adapter;

0 comments on commit 4882b8b

Please sign in to comment.