-
Notifications
You must be signed in to change notification settings - Fork 191
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #365 from ktarun1419/master
added Chad USD
- Loading branch information
Showing
2 changed files
with
74 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
import { ChainBlocks, PeggedIssuanceAdapter } from "../peggedAsset.type"; | ||
const sdk = require("@defillama/sdk"); | ||
|
||
const chainContracts = { | ||
scroll: { | ||
issued: "0x9F24de635C78C5Df77F9EA9aA3C6D71FfcabEc8f", | ||
}, | ||
}; | ||
|
||
async function scrollMinted() { | ||
return async function ( | ||
_timestamp: number, | ||
_ethBlock: number, | ||
_chainBlocks: ChainBlocks | ||
) { | ||
const totalSupply = ( | ||
await sdk.api.abi.call({ | ||
abi: "function vaultInfo(address vault) external view returns (tuple( uint128 conjureLimit , uint128 totalConjured))", | ||
target: chainContracts.scroll.issued, | ||
params: ["0x3bdfe67009FEbf4bc65378F1C07E7FfEF5339407"], | ||
block: _ethBlock, | ||
chain: "scroll", | ||
}) | ||
).output; | ||
return { peggedUSD: totalSupply[1] / 10 ** 18 }; | ||
}; | ||
} | ||
|
||
const adapter: PeggedIssuanceAdapter = { | ||
scroll: { | ||
minted: scrollMinted(), | ||
}, | ||
}; | ||
|
||
export default adapter; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters