Skip to content

Commit 3037490

Browse files
authored
Merge pull request #266 from Define101/master
small modifications to #264 + listing EURO3
2 parents 94830e0 + d047bc9 commit 3037490

File tree

3 files changed

+83
-1
lines changed

3 files changed

+83
-1
lines changed
Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
const sdk = require("@defillama/sdk");
2+
import { sumSingleBalance } from "../helper/generalUtil";
3+
import {
4+
ChainBlocks,
5+
PeggedIssuanceAdapter,
6+
Balances,
7+
} from "../peggedAsset.type";
8+
9+
type ChainContracts = {
10+
[chain: string]: {
11+
issued: string;
12+
unreleased: string[];
13+
};
14+
};
15+
16+
const chainContracts: ChainContracts = {
17+
polygon: {
18+
issued: "0xA0e4c84693266a9d3BBef2f394B33712c76599Ab",
19+
unreleased: [],
20+
},
21+
};
22+
23+
async function chainMinted(chain: string, decimals: number) {
24+
return async function (
25+
_timestamp: number,
26+
_ethBlock: number,
27+
_chainBlocks: ChainBlocks
28+
) {
29+
let balances = {} as Balances;
30+
const totalSupply = (
31+
await sdk.api.abi.call({
32+
abi: "erc20:totalSupply",
33+
target: chainContracts[chain].issued,
34+
block: _chainBlocks?.[chain],
35+
chain: chain,
36+
})
37+
).output;
38+
sumSingleBalance(
39+
balances,
40+
"peggedEUR",
41+
totalSupply / 10 ** decimals,
42+
"issued",
43+
false
44+
);
45+
return balances;
46+
};
47+
}
48+
49+
const adapter: PeggedIssuanceAdapter = {
50+
polygon: {
51+
minted: chainMinted("polygon", 18),
52+
unreleased: async () => ({}),
53+
},
54+
};
55+
56+
export default adapter;

src/adapters/peggedAssets/index.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -167,6 +167,7 @@ import audd from "./novatti-australian-digital-dollar";
167167
import cgusd from "./cygnus-finance-global-usd";
168168
import feth from "./feth"
169169
import fxusd from "./fxusd"
170+
import euro3 from "./euro3"
170171

171172
export default {
172173
tether,
@@ -337,5 +338,6 @@ export default {
337338
"novatti-australian-digital-dollar": audd,
338339
"cygnus-finance-global-usd": cgusd,
339340
"f-x-protocol-fractional-eth": feth,
340-
"f-x-protocol-usd": fxusd
341+
"f-x-protocol-usd": fxusd,
342+
euro3 //since its the real coingecko id + same symbol we good with this. I think no need to "euro3": euro3
341343
};

src/peggedData/peggedData.ts

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3401,4 +3401,28 @@ export default [
34013401
twitter: "https://twitter.com/goku_stable",
34023402
wiki: null,
34033403
},
3404+
{
3405+
id: "170",
3406+
name: "EURO3",
3407+
address: "polygon:0xA0e4c84693266a9d3BBef2f394B33712c76599Ab",
3408+
symbol: "EURO3",
3409+
url: "https://3adao.org/",
3410+
description:
3411+
"EURO3 is an over-collateralized, decentralized, variable supply payment coin pegged to the Euro.",
3412+
mintRedeemDescription:
3413+
"EURO3 is created by users minting EURO3 loans and it's removed from circulation (burnt) when users repay their loan or redeem EURO3 for the collateral assets.",
3414+
onCoinGecko: "true",
3415+
gecko_id: "euro3",
3416+
cmcId: null,
3417+
pegType: "peggedEUR",
3418+
pegMechanism: "crypto-backed",
3419+
priceSource: "coingecko",
3420+
auditLinks: [
3421+
"https://docs.3adao.org/3a-protocol/technical-documentation/audit-report",
3422+
"https://www.hypernative.io/certificate/3a-dao",
3423+
"https://www.fyeo.io/post/fyeo-3a-dao-security-assessment",
3424+
],
3425+
twitter: "https://twitter.com/3aaaDAO",
3426+
wiki: null,
3427+
},
34043428
] as PeggedAsset[];

0 commit comments

Comments
 (0)