Skip to content

NoahPay/smartContracts

 
 

Repository files navigation

FrankenCoin

This is the source code repository for the smart contracts of the oracle-free, collateralized stablecoin Frankencoin.

There also is a public frontend, a documentation page, an outdated Frankencoin Research Paper, and a more recent chapter of a pending phd thesis.

Source Code

The source code can be found in the contracts folder. The following are the most important contracts.

Contract Description
Frankencoin.sol The Frankencoin (ZCHF) ERC20 token
Equity.sol The Frankencoin Pool Shares (FPS) ERC20 token
MintingHub.sol Plugin for oracle-free collateralized minting
Position.sol A borrowed minting position holding collateral
StablecoinBridge.sol Plugin for 1:1 swaps with other CHF stablecoins

Compiling and Testing

The project is setup to be compiled and tested with hardhat. Assuming node.js is already present, try commands like these to get ready:

npm install --global hardhat-shorthand
yarn

Once all is there, you can compile or compile & test using these two commands:

hh compile
hh test
hh coverage

Deployment

Define the private key from your deployer address and etherscan api key as an environment variable in .env file.

PK=0x123456
APIKEY=123456

Then run a deployment script with tags and network params (e.g., sepolia that specifies the network)

Recommanded commands for sepolia network.

hh deploy --network sepolia --tags MockTokens
hh deploy --network sepolia --tags Frankencoin
hh deploy --network sepolia --tags PositionFactory
hh deploy --network sepolia --tags MintingHub
hh deploy --network sepolia --tags MockCHFToken
hh deploy --network sepolia --tags XCHFBridge
hh deploy --network sepolia --tags positions

The networks are configured in hardhat.config.ts.

npx hardhat verify "0x..." --network sepolia

About

dEURO Smart Contracts

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Solidity 45.7%
  • TypeScript 43.0%
  • Python 7.7%
  • C# 3.6%