@@ -10,6 +10,8 @@ import {IBondMinter} from "./interfaces/IBondMinter.sol";
1010// Minor Modification to button wood's version
1111// https://github.com/buttonwood-protocol/tranche/blob/main/contracts/bondMinter/
1212// in ours configs are immutable and we limit one config per minter
13+ // and we have a way of checking the config hash of a given bond
14+ // This can be extened to multi-config
1315contract BondMinter is IBondMinter {
1416 // bond factory
1517 IBondFactory public immutable bondFactory;
@@ -20,7 +22,7 @@ contract BondMinter is IBondMinter {
2022
2123 // minter bond config
2224 IBondMinter.BondConfig public config;
23- bytes32 public immutable override configHash ;
25+ bytes32 private immutable _configHash ;
2426
2527 // mapping of minted bonds
2628 mapping (address => bool ) mintedBonds;
@@ -30,7 +32,7 @@ contract BondMinter is IBondMinter {
3032 bondFactory = bondFactory_;
3133 waitingPeriod = waitingPeriod_;
3234 config = config_;
33- configHash = computeHash (config_);
35+ _configHash = computeHash (config_);
3436 lastMintTimestamp = 0 ;
3537
3638 emit BondConfigAdded (config);
@@ -59,6 +61,10 @@ contract BondMinter is IBondMinter {
5961 emit BondMinted (bond);
6062 }
6163
64+ function getConfigHash (address bond ) external view override returns (bytes32 ) {
65+ return mintedBonds[bond] ? _configHash : bytes32 (0 );
66+ }
67+
6268 function computeHash (IBondMinter.BondConfig memory config_ ) private pure returns (bytes32 ) {
6369 return keccak256 (abi.encode (config_.collateralToken, config_.trancheRatios, config_.duration));
6470 }
0 commit comments