Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
49 changed files
with
130,005 additions
and
67 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
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
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,55 @@ | ||
// SPDX-License-Identifier: AGPL-3.0-or-later | ||
pragma solidity 0.8.0; | ||
|
||
import "../../masset/MassetStructs.sol"; | ||
import { FeederLogic } from "../../feeders/FeederLogic.sol"; | ||
|
||
contract ExposedFeederLogic { | ||
|
||
function computeMint( | ||
BassetData[] memory _bAssets, | ||
uint8 _i, | ||
uint256 _rawInput, | ||
FeederConfig memory _config | ||
) public view returns (uint256 mintAmount) { | ||
return FeederLogic.computeMint(_bAssets, _i, _rawInput, _config); | ||
} | ||
|
||
function computeMintMulti( | ||
BassetData[] memory _bAssets, | ||
uint8[] memory _indices, | ||
uint256[] memory _rawInputs, | ||
FeederConfig memory _config | ||
) public view returns (uint256 mintAmount) { | ||
return FeederLogic.computeMintMulti(_bAssets, _indices, _rawInputs, _config); | ||
} | ||
|
||
function computeSwap( | ||
BassetData[] memory _bAssets, | ||
uint8 _i, | ||
uint8 _o, | ||
uint256 _rawInput, | ||
uint256 _feeRate, | ||
FeederConfig memory _config | ||
) public view returns (uint256 bAssetOutputQuantity, uint256 scaledSwapFee) { | ||
return FeederLogic.computeSwap(_bAssets, _i, _o, _rawInput, _feeRate, _config); | ||
} | ||
|
||
function computeRedeem( | ||
BassetData[] memory _bAssets, | ||
uint8 _o, | ||
uint256 _netMassetQuantity, | ||
FeederConfig memory _config | ||
) public view returns (uint256 rawOutputUnits) { | ||
return FeederLogic.computeRedeem(_bAssets, _o, _netMassetQuantity, _config); | ||
} | ||
|
||
function computeRedeemExact( | ||
BassetData[] memory _bAssets, | ||
uint8[] memory _indices, | ||
uint256[] memory _rawOutputs, | ||
FeederConfig memory _config | ||
) public view returns (uint256 totalmAssets) { | ||
return FeederLogic.computeRedeemExact(_bAssets, _indices, _rawOutputs, _config); | ||
} | ||
} |
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,11 @@ | ||
// SPDX-License-Identifier: AGPL-3.0-or-later | ||
pragma solidity 0.8.0; | ||
|
||
import "../../masset/MassetStructs.sol"; | ||
import { FeederPool } from "../../feeders/FeederPool.sol"; | ||
|
||
contract ExposedFeederPool is FeederPool { | ||
|
||
constructor(address _nexus, address _mAsset) FeederPool(_nexus, _mAsset) {} | ||
|
||
} |
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
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
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
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,43 @@ | ||
// import fullIntegrationData from "./full/crossIntegrationData.json" | ||
// import fullMintData from "./full/crossMintData.json" | ||
// import fullSwapToFassetData from "./full/swapToFassetData.json" | ||
// import fullSwapToMPassetData from "./full/swapToMPassetData.json" | ||
// import fullRedeemData from "./full/crossRedeemData.json" | ||
|
||
import sampleIntegrationData from "./sample/crossIntegrationData.json" | ||
import sampleMintData from "./sample/crossMintData.json" | ||
import sampleSwapToFassetData from "./sample/swapToFassetData.json" | ||
import sampleSwapToMPassetData from "./sample/swapToMPassetData.json" | ||
import sampleRedeemData from "./sample/crossRedeemData.json" | ||
|
||
interface Data { | ||
full | ||
sample | ||
} | ||
|
||
const integrationData: Data = { | ||
full: null, | ||
sample: sampleIntegrationData, | ||
} | ||
|
||
const mintData: Data = { | ||
full: null, | ||
sample: sampleMintData, | ||
} | ||
|
||
const swapToFassetData: Data = { | ||
full: null, | ||
sample: sampleSwapToFassetData, | ||
} | ||
|
||
const swapToMPassetData: Data = { | ||
full: null, | ||
sample: sampleSwapToMPassetData, | ||
} | ||
|
||
const redeemData: Data = { | ||
full: null, | ||
sample: sampleRedeemData, | ||
} | ||
|
||
export default { integrationData, mintData, swapToFassetData, swapToMPassetData, redeemData } |
Oops, something went wrong.