Skip to content

Commit

Permalink
Merge pull request #215 from Define101/master
Browse files Browse the repository at this point in the history
listing SCB
  • Loading branch information
Define101 authored Jan 5, 2024
2 parents 57fa1f1 + b1ef251 commit c9aa6b6
Show file tree
Hide file tree
Showing 3 changed files with 79 additions and 1 deletion.
56 changes: 56 additions & 0 deletions src/adapters/peggedAssets/colb-usd-stablecolb/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
const sdk = require("@defillama/sdk");
import { sumSingleBalance } from "../helper/generalUtil";
import {
ChainBlocks,
PeggedIssuanceAdapter,
Balances,
} from "../peggedAsset.type";

type ChainContracts = {
[chain: string]: {
[contract: string]: string[];
};
};

const chainContracts: ChainContracts = {
polygon: {
issued: ["0x72C96C73207936E94066b4C8566C6987c9a1f1dE"],
},
};

async function chainMinted(chain: string, decimals: number) {
return async function (
_timestamp: number,
_ethBlock: number,
_chainBlocks: ChainBlocks
) {
let balances = {} as Balances;
for (let issued of chainContracts[chain].issued) {
const totalSupply = (
await sdk.api.abi.call({
abi: "erc20:totalSupply",
target: issued,
block: _chainBlocks?.[chain],
chain: chain,
})
).output;
sumSingleBalance(
balances,
"peggedUSD",
totalSupply / 10 ** decimals,
"issued",
false
);
}
return balances;
};
}

const adapter: PeggedIssuanceAdapter = {
polygon: {
minted: chainMinted("polygon", 18),
unreleased: async () => ({}),
},
};

export default adapter;
4 changes: 3 additions & 1 deletion src/adapters/peggedAssets/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,7 @@ import usde from "./ethena-usde";
import aeur from "./anchored-coins-eur";
import myusd from "./myusd";
import usds from "./sable-coin";
import scb from "./colb-usd-stablecolb"

export default {
tether,
Expand Down Expand Up @@ -297,5 +298,6 @@ export default {
"ethena-usde": usde,
"anchored-coins-eur": aeur,
myusd, //fake coingecko, replace once live
"sable-coin": usds
"sable-coin": usds,
"colb-usd-stablecolb": scb
};
20 changes: 20 additions & 0 deletions src/peggedData/peggedData.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3002,4 +3002,24 @@ export default [
twitter: "https://twitter.com/SableFinance",
wiki: "https://sable-finance.gitbook.io/docs/",
},
{
id: "150",
name: "USD Stable Colb",
address: "polygon:0x72c96c73207936e94066b4c8566c6987c9a1f1de",
symbol: "SCB",
url: "https://www.colb.finance",
description:
"A USD-backed stablecoin, strictly pegged 1:1 to the United States Dollar and issued in full compliance with Swiss legislation. SCB is fully collateralised by cash and cash equivalents, securely held in custody with a Swiss private bank and verified by third-party attestations.",
mintRedeemDescription:
"When a user triggers an SCB issuance request through a USD bank transfer, our compliance team undertakes an initial verification to uphold regulatory adherence. When a whitelisted user decides to redeem SCB, he must firstly sign a transaction in his non-custodial wallet to send the SCB to the burn address. At this stage, our compliance team is informed and undertakes a client file verification. Then, Colb Trust advances to reduce the circulating supply, ultimately burning the stablecoins. Then it is the custodian bank's job to be as efficient as possible to send the USD bank transfer to the user (1 to 4 business days).",
onCoinGecko: "true",
gecko_id: "colb-usd-stablecolb",
cmcId: null,
pegType: "peggedUSD",
pegMechanism: "fiat-backed",
priceSource: "coingecko",
auditLinks: null,
twitter: "https://twitter.com/colb_finance",
wiki: "https://www.colb.finance/faq",
},
] as PeggedAsset[];

0 comments on commit c9aa6b6

Please sign in to comment.