diff --git a/contracts/addresses/1.json b/contracts/addresses/1.json index 88864e27d..7d4d785b8 100644 --- a/contracts/addresses/1.json +++ b/contracts/addresses/1.json @@ -15,6 +15,7 @@ "debtInFrontHelper": "0x4bb5e28fdb12891369b560f2fab3c032600677c6", "exchangeHelpers": "0x2f60bab0072abec7058017f48d7256ec288c8686", "exchangeHelpersV2": "0xe453b864d3841469763bda2437e3dd0e38dca222", + "redemptionHelper": "0x0000000000000000000000000000000000000000", "branches": [ { "collSymbol": "WETH", diff --git a/contracts/addresses/11155111.json b/contracts/addresses/11155111.json index 0cbdd9f76..85f61f2ee 100644 --- a/contracts/addresses/11155111.json +++ b/contracts/addresses/11155111.json @@ -15,6 +15,7 @@ "debtInFrontHelper": "0x99d799D62611849D4D1dA5FF770147164873Eb99", "exchangeHelpers": "0x2b50462f3026446fa9f6e618f3f08a67aae96317", "exchangeHelpersV2": "0x3fff2e6b2f7fb3121d966c1d67fa8f3ab5a99f3f", + "redemptionHelper": "0xf299f3c504904c5f0b67f0ea0caf745d8912dc45", "branches": [ { "collSymbol": "WETH", diff --git a/contracts/broadcast/DeployRedemptionHelper.s.sol/11155111/run-1761890347448.json b/contracts/broadcast/DeployRedemptionHelper.s.sol/11155111/run-1761890347448.json new file mode 100644 index 000000000..17f31972f --- /dev/null +++ b/contracts/broadcast/DeployRedemptionHelper.s.sol/11155111/run-1761890347448.json @@ -0,0 +1,49 @@ +{ + "transactions": [ + { + "hash": "0x4fa985964bb99247035251efeaa94e88697c47c410fb5d23b3db4b58b96223fd", + "transactionType": "CREATE", + "contractName": "RedemptionHelper", + "contractAddress": "0xf299f3c504904c5f0b67f0ea0caf745d8912dc45", + "function": null, + "arguments": [ + "0xFAe08e80e0598EBeCb8a3aCf0eb8f85922e7Cae1", + "[0x0dBCB1229B43b1D2FE0B63235bF64e7c8034B98e, 0x839017Ef9366c7A1b094e8CCe1bF45FCcCA5C55a, 0xb847b61a58B103dC3163091a294c8F270cD6df0a]" + ], + "transaction": { + "from": "0xb32073560ba0a715497886d4a4dd83ee9be71390", + "gas": "0x2597af", + "value": "0x0", + "input": "0x60e060405234801562000010575f80fd5b50604051620024343803806200243483398101604081905262000033916200035e565b816001600160a01b03166330504b6f6040518163ffffffff1660e01b8152600401602060405180830381865afa15801562000070573d5f803e3d5ffd5b505050506040513d601f19601f8201168201806040525081019062000096919062000444565b815114620000eb5760405162461bcd60e51b815260206004820152601a60248201527f57726f6e67206e756d626572206f66207265676973747269657300000000000060448201526064015b60405180910390fd5b80516080526001600160a01b03821660a08190526040805163630afce560e01b8152905163630afce5916004808201926020929091908290030181865afa15801562000139573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906200015f91906200045c565b6001600160a01b031660c0525f5b815181101562000317578181815181106200018c576200018c62000481565b60200260200101516001600160a01b0316633d83908a6040518163ffffffff1660e01b8152600401602060405180830381865afa158015620001d0573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190620001f691906200045c565b604051630bc17feb60e01b8152600481018390526001600160a01b0391821691851690630bc17feb90602401602060405180830381865afa1580156200023e573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906200026491906200045c565b6001600160a01b031614620002bc5760405162461bcd60e51b815260206004820152601560248201527f54726f76654d616e61676572206d69736d6174636800000000000000000000006044820152606401620000e2565b5f828281518110620002d257620002d262000481565b6020908102919091018101518254600180820185555f9485529290932090920180546001600160a01b0319166001600160a01b0390931692909217909155016200016d565b50505062000495565b6001600160a01b038116811462000335575f80fd5b50565b634e487b7160e01b5f52604160045260245ffd5b8051620003598162000320565b919050565b5f806040838503121562000370575f80fd5b82516200037d8162000320565b602084810151919350906001600160401b03808211156200039c575f80fd5b818601915086601f830112620003b0575f80fd5b815181811115620003c557620003c562000338565b8060051b604051601f19603f83011681018181108582111715620003ed57620003ed62000338565b6040529182528482019250838101850191898311156200040b575f80fd5b938501935b82851015620004345762000424856200034c565b8452938501939285019262000410565b8096505050505050509250929050565b5f6020828403121562000455575f80fd5b5051919050565b5f602082840312156200046d575f80fd5b81516200047a8162000320565b9392505050565b634e487b7160e01b5f52603260045260245ffd5b60805160a05160c051611ef86200053c5f395f818160ae015281816108ae0152818161094401528181610be80152610c7f01525f8181610137015281816102ae0152818161074c01526109db01525f818160ed015281816101bc01528181610323015281816103a50152818161061d0152818161068e0152818161071001528181610a3e01528181610d0101528181610dc4015281816110ae01526111d50152611ef85ff3fe608060405234801561000f575f80fd5b506004361061007a575f3560e01c8063c8c52fb711610058578063c8c52fb71461011d578063d330fadd14610132578063dfa397d714610159578063edf26d9b1461017a575f80fd5b80632b9f137c1461007e578063630afce5146100a95780636c088de8146100e8575b5f80fd5b61009161008c3660046119f1565b61018d565b6040516100a093929190611a11565b60405180910390f35b6100d07f000000000000000000000000000000000000000000000000000000000000000081565b6040516001600160a01b0390911681526020016100a0565b61010f7f000000000000000000000000000000000000000000000000000000000000000081565b6040519081526020016100a0565b61013061012b366004611ae1565b6105c7565b005b6100d07f000000000000000000000000000000000000000000000000000000000000000081565b61016c6101673660046119f1565b610cfc565b6040516100a0929190611b9e565b6100d0610188366004611c42565b6116fd565b5f8060605f8061019d8787610cfc565b91509150805f036101b5575f809450945050506105c0565b8694505f5b7f0000000000000000000000000000000000000000000000000000000000000000811015610297578281815181106101f4576101f4611c59565b602002602001015160400151801561022857505f83828151811061021a5761021a611c59565b602002602001015160800151115b1561028f575f83828151811061024057610240611c59565b6020026020010151608001518385848151811061025f5761025f611c59565b602002602001015160c001516102759190611c81565b61027f9190611c98565b90508681101561028d578096505b505b6001016101ba565b506040516331f889a760e11b8152600481018690527f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316906363f1134e90602401602060405180830381865afa1580156102fb573d5f803e3d5ffd5b505050506040513d601f19601f8201168201806040525081019061031f9190611cb7565b93507f000000000000000000000000000000000000000000000000000000000000000067ffffffffffffffff81111561035a5761035a611a72565b60405190808252806020026020018201604052801561039e57816020015b604080518082019091525f80825260208201528152602001906001900390816103785790505b5092505f5b7f00000000000000000000000000000000000000000000000000000000000000008110156105bc578281815181106103dd576103dd611c59565b602002602001015160400151801561041157505f83828151811061040357610403611c59565b602002602001015160800151115b156105b4575f80828154811061042957610429611c59565b5f918252602091829020015460408051633a0df78d60e11b815290516001600160a01b039092169263741bef1a926004808401938290030181865afa158015610474573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906104989190611ce5565b6001600160a01b031663b5b65cef6040518163ffffffff1660e01b815260040160408051808303815f875af11580156104d3573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906104f79190611d1b565b5090508284838151811061050d5761050d611c59565b602002602001015160800151886105249190611c81565b61052e9190611c98565b85838151811061054057610540611c59565b6020908102919091010151528061055f87670de0b6b3a7640000611d45565b86848151811061057157610571611c59565b60200260200101515f01516105869190611c81565b6105909190611c98565b8583815181106105a2576105a2611c59565b60200260200101516020018181525050505b6001016103a3565b5050505b9250925092565b5f841161061b5760405162461bcd60e51b815260206004820181905260248201527f52656465656d656420616d6f756e74206d757374206265206e6f6e2d7a65726f60448201526064015b60405180910390fd5b7f000000000000000000000000000000000000000000000000000000000000000081511461068b5760405162461bcd60e51b815260206004820152601d60248201527f57726f6e67205f6d696e436f6c6c52656465656d6564206c656e6774680000006044820152606401610612565b5f7f000000000000000000000000000000000000000000000000000000000000000067ffffffffffffffff8111156106c5576106c5611a72565b60405190808252806020026020018201604052801561070957816020015b604080518082019091525f80825260208201528152602001906001900390816106e35790505b5090505f5b7f000000000000000000000000000000000000000000000000000000000000000081101561089657604051631c96a19760e31b8152600481018290527f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03169063e4b50cb890602401602060405180830381865afa158015610799573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906107bd9190611ce5565b8282815181106107cf576107cf611c59565b60209081029190910101516001600160a01b03909116905281518290829081106107fb576107fb611c59565b6020908102919091010151516040516370a0823160e01b81523060048201526001600160a01b03909116906370a0823190602401602060405180830381865afa15801561084a573d5f803e3d5ffd5b505050506040513d601f19601f8201168201806040525081019061086e9190611cb7565b82828151811061088057610880611c59565b602090810291909101810151015260010161070e565b506040516370a0823160e01b81523060048201525f907f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316906370a0823190602401602060405180830381865afa1580156108fb573d5f803e3d5ffd5b505050506040513d601f19601f8201168201806040525081019061091f9190611cb7565b6040516323b872dd60e01b8152336004820152306024820152604481018890529091507f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316906323b872dd906064016020604051808303815f875af1158015610992573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906109b69190611d58565b5060405163ab6d53bd60e01b81526004810187905260248101869052604481018590527f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03169063ab6d53bd906064015f604051808303815f87803b158015610a24575f80fd5b505af1158015610a36573d5f803e3d5ffd5b505050505f5b7f0000000000000000000000000000000000000000000000000000000000000000811015610bc6575f838281518110610a7757610a77611c59565b602002602001015160200151848381518110610a9557610a95611c59565b6020908102919091010151516040516370a0823160e01b81523060048201526001600160a01b03909116906370a0823190602401602060405180830381865afa158015610ae4573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190610b089190611cb7565b610b129190611d45565b9050848281518110610b2657610b26611c59565b6020026020010151811015610b7d5760405162461bcd60e51b815260206004820181905260248201527f496e73756666696369656e7420636f6c6c61746572616c2072656465656d65646044820152606401610612565b8015610bbd57610bbd3382868581518110610b9a57610b9a611c59565b60200260200101515f01516001600160a01b03166117249092919063ffffffff16565b50600101610a3c565b506040516370a0823160e01b81523060048201525f9082906001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016906370a0823190602401602060405180830381865afa158015610c2d573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190610c519190611cb7565b610c5b9190611d45565b90508015610cf35760405163a9059cbb60e01b8152336004820152602481018290527f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03169063a9059cbb906044016020604051808303815f875af1158015610ccd573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190610cf19190611d58565b505b50505050505050565b60605f7f000000000000000000000000000000000000000000000000000000000000000067ffffffffffffffff811115610d3857610d38611a72565b604051908082528060200260200182016040528015610dbd57816020015b610daa6040518061010001604052805f6001600160a01b031681526020015f6001600160a01b031681526020015f151581526020015f81526020015f81526020015f81526020015f81526020015f81525090565b815260200190600190039081610d565790505b5091505f5b7f000000000000000000000000000000000000000000000000000000000000000081101561108b575f8181548110610dfc57610dfc611c59565b5f918252602091829020015460408051631ec1c84560e11b815290516001600160a01b0390921692633d83908a926004808401938290030181865afa158015610e47573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190610e6b9190611ce5565b838281518110610e7d57610e7d611c59565b60209081029190910101516001600160a01b0390911690525f805482908110610ea857610ea8611c59565b5f918252602091829020015460408051632ba461d560e21b815290516001600160a01b039092169263ae918754926004808401938290030181865afa158015610ef3573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190610f179190611ce5565b838281518110610f2957610f29611c59565b6020026020010151602001906001600160a01b031690816001600160a01b031681525050828181518110610f5f57610f5f611c59565b60200260200101515f01516001600160a01b0316634ea15f376040518163ffffffff1660e01b81526004016060604051808303815f875af1158015610fa6573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190610fca9190611d71565b858481518110610fdc57610fdc611c59565b6020026020010151608001868581518110610ff957610ff9611c59565b602002602001015160600187868151811061101657611016611c59565b60200260200101516040018315151515815250838152508381525050505082818151811061104657611046611c59565b602002602001015160400151156110835782818151811061106957611069611c59565b602002602001015160800151826110809190611da3565b91505b600101610dc2565b50805f10801561109a57508381105b156110a3578093505b805f036111cb575f5b7f00000000000000000000000000000000000000000000000000000000000000008110156111c9578281815181106110e6576110e6611c59565b60200260200101515f01516001600160a01b031663105b403b6040518163ffffffff1660e01b8152600401602060405180830381865afa15801561112c573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906111509190611cb7565b83828151811061116257611162611c59565b6020026020010151608001818152505082818151811061118457611184611c59565b602002602001015160400151156111c1578281815181106111a7576111a7611c59565b602002602001015160800151826111be9190611da3565b91505b6001016110ac565b505b80156116f6575f5b7f00000000000000000000000000000000000000000000000000000000000000008110156116f45782818151811061120d5761120d611c59565b602002602001015160400151156116ec578183828151811061123157611231611c59565b602002602001015160800151866112489190611c81565b6112529190611c98565b83828151811061126457611264611c59565b602002602001015160a001818152505082818151811061128657611286611c59565b602002602001015160a001515f03156116ec575f8382815181106112ac576112ac611c59565b60200260200101515f01516001600160a01b031663015402876040518163ffffffff1660e01b8152600401602060405180830381865afa1580156112f2573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906113169190611cb7565b90505f84838151811061132b5761132b611c59565b6020026020010151602001516001600160a01b0316634d6228316040518163ffffffff1660e01b8152600401602060405180830381865afa158015611372573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906113969190611cb7565b90505f80835f0361143157828786815181106113b4576113b4611c59565b6020026020010151602001516001600160a01b0316631037a5f4856040518263ffffffff1660e01b81526004016113ed91815260200190565b602060405180830381865afa158015611408573d5f803e3d5ffd5b505050506040513d601f19601f8201168201806040525081019061142c9190611cb7565b611434565b83835b915091505f87868151811061144b5761144b611c59565b602002602001015160e00181815250505b8787868151811061146f5761146f611c59565b602002602001015160e001511080611485575087155b156116e75786858151811061149c5761149c611c59565b602002602001015160a001518786815181106114ba576114ba611c59565b602002602001015160c0015114806114d0575081155b6116e7575f8786815181106114e7576114e7611c59565b60200260200101515f01516001600160a01b031663aad3f404846040518263ffffffff1660e01b815260040161151f91815260200190565b61014060405180830381865afa15801561153b573d5f803e3d5ffd5b505050506040513d601f19601f8201168201806040525081019061155f9190611db6565b9050670de0b6b3a7640000815f015189888151811061158057611580611c59565b602002602001015160600151836020015161159b9190611c81565b6115a59190611c98565b10611628576115fa8887815181106115bf576115bf611c59565b602002602001015160c001518988815181106115dd576115dd611c59565b602002602001015160a001516115f39190611d45565b825161177b565b88878151811061160c5761160c611c59565b602002602001015160c0018181516116249190611da3565b9052505b81925087868151811061163d5761163d611c59565b6020026020010151602001516001600160a01b0316631037a5f4836040518263ffffffff1660e01b815260040161167691815260200190565b602060405180830381865afa158015611691573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906116b59190611cb7565b9150508685815181106116ca576116ca611c59565b602002602001015160e00180516116e090611e3b565b905261145c565b505050505b6001016111d3565b505b9250929050565b5f818154811061170b575f80fd5b5f918252602090912001546001600160a01b0316905081565b604080516001600160a01b038416602482015260448082018490528251808303909101815260649091019091526020810180516001600160e01b031663a9059cbb60e01b179052611776908490611794565b505050565b5f818310611789578161178b565b825b90505b92915050565b5f6117e8826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b03166118679092919063ffffffff16565b905080515f14806118085750808060200190518101906118089190611d58565b6117765760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6044820152691bdd081cdd58d8d9595960b21b6064820152608401610612565b606061187584845f8561187d565b949350505050565b6060824710156118de5760405162461bcd60e51b815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f6044820152651c8818d85b1b60d21b6064820152608401610612565b5f80866001600160a01b031685876040516118f99190611e75565b5f6040518083038185875af1925050503d805f8114611933576040519150601f19603f3d011682016040523d82523d5f602084013e611938565b606091505b509150915061194987838387611954565b979650505050505050565b606083156119c25782515f036119bb576001600160a01b0385163b6119bb5760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e74726163740000006044820152606401610612565b5081611875565b61187583838151156119d75781518083602001fd5b8060405162461bcd60e51b81526004016106129190611e90565b5f8060408385031215611a02575f80fd5b50508035926020909101359150565b5f6060820185835260208560208501526040606060408601528286518085526080870191506020880194505f5b81811015611a6357855180518452850151858401529484019491830191600101611a3e565b50909998505050505050505050565b634e487b7160e01b5f52604160045260245ffd5b604051610140810167ffffffffffffffff81118282101715611aaa57611aaa611a72565b60405290565b604051601f8201601f1916810167ffffffffffffffff81118282101715611ad957611ad9611a72565b604052919050565b5f805f8060808587031215611af4575f80fd5b84359350602080860135935060408601359250606086013567ffffffffffffffff80821115611b21575f80fd5b818801915088601f830112611b34575f80fd5b813581811115611b4657611b46611a72565b8060051b9150611b57848301611ab0565b818152918301840191848101908b841115611b70575f80fd5b938501935b83851015611b8e57843582529385019390850190611b75565b989b979a50959850505050505050565b604080825283518282018190525f9190606090818501906020808901865b83811015611c2b57815180516001600160a01b0390811687528482015116848701528781015115158887015286810151878701526080808201519087015260a0808201519087015260c0808201519087015260e090810151908601526101009094019390820190600101611bbc565b505050508093505050508260208301529392505050565b5f60208284031215611c52575f80fd5b5035919050565b634e487b7160e01b5f52603260045260245ffd5b634e487b7160e01b5f52601160045260245ffd5b808202811582820484141761178e5761178e611c6d565b5f82611cb257634e487b7160e01b5f52601260045260245ffd5b500490565b5f60208284031215611cc7575f80fd5b5051919050565b6001600160a01b0381168114611ce2575f80fd5b50565b5f60208284031215611cf5575f80fd5b8151611d0081611cce565b9392505050565b80518015158114611d16575f80fd5b919050565b5f8060408385031215611d2c575f80fd5b82519150611d3c60208401611d07565b90509250929050565b8181038181111561178e5761178e611c6d565b5f60208284031215611d68575f80fd5b61178b82611d07565b5f805f60608486031215611d83575f80fd5b8351925060208401519150611d9a60408501611d07565b90509250925092565b8082018082111561178e5761178e611c6d565b5f6101408284031215611dc7575f80fd5b611dcf611a86565b825181526020830151602082015260408301516040820152606083015160608201526080830151608082015260a083015160a082015260c083015160c082015260e083015160e08201526101008084015181830152506101208084015181830152508091505092915050565b5f60018201611e4c57611e4c611c6d565b5060010190565b5f5b83811015611e6d578181015183820152602001611e55565b50505f910152565b5f8251611e86818460208701611e53565b9190910192915050565b602081525f8251806020840152611eae816040850160208701611e53565b601f01601f1916919091016040019291505056fea264697066735822122003eb4c9aef9f87887838b06a3da359c8b884fbbaaac8334fcaad45fd78facaca64736f6c63430008180033000000000000000000000000fae08e80e0598ebecb8a3acf0eb8f85922e7cae1000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000030000000000000000000000000dbcb1229b43b1d2fe0b63235bf64e7c8034b98e000000000000000000000000839017ef9366c7a1b094e8cce1bf45fccca5c55a000000000000000000000000b847b61a58b103dc3163091a294c8f270cd6df0a", + "nonce": "0x1f2", + "chainId": "0xaa36a7" + }, + "additionalContracts": [], + "isFixedGasLimit": false + } + ], + "receipts": [ + { + "status": "0x1", + "cumulativeGasUsed": "0x1a1c701", + "logs": [], + "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "type": "0x2", + "transactionHash": "0x4fa985964bb99247035251efeaa94e88697c47c410fb5d23b3db4b58b96223fd", + "transactionIndex": "0x51", + "blockHash": "0xb15949a0e95feb80a4d0a0bc70f1225f844efc78173187d87f055479fc0ff717", + "blockNumber": "0x916309", + "gasUsed": "0x1cead6", + "effectiveGasPrice": "0xf424a", + "from": "0xb32073560ba0a715497886d4a4dd83ee9be71390", + "to": null, + "contractAddress": "0xf299f3c504904c5f0b67f0ea0caf745d8912dc45" + } + ], + "libraries": [], + "pending": [], + "returns": {}, + "timestamp": 1761890347448, + "chain": 11155111, + "commit": "95c3b609" +} \ No newline at end of file diff --git a/contracts/broadcast/DeployRedemptionHelper.s.sol/11155111/run-latest.json b/contracts/broadcast/DeployRedemptionHelper.s.sol/11155111/run-latest.json new file mode 100644 index 000000000..17f31972f --- /dev/null +++ b/contracts/broadcast/DeployRedemptionHelper.s.sol/11155111/run-latest.json @@ -0,0 +1,49 @@ +{ + "transactions": [ + { + "hash": "0x4fa985964bb99247035251efeaa94e88697c47c410fb5d23b3db4b58b96223fd", + "transactionType": "CREATE", + "contractName": "RedemptionHelper", + "contractAddress": "0xf299f3c504904c5f0b67f0ea0caf745d8912dc45", + "function": null, + "arguments": [ + "0xFAe08e80e0598EBeCb8a3aCf0eb8f85922e7Cae1", + "[0x0dBCB1229B43b1D2FE0B63235bF64e7c8034B98e, 0x839017Ef9366c7A1b094e8CCe1bF45FCcCA5C55a, 0xb847b61a58B103dC3163091a294c8F270cD6df0a]" + ], + "transaction": { + "from": "0xb32073560ba0a715497886d4a4dd83ee9be71390", + "gas": "0x2597af", + "value": "0x0", + "input": "0x60e060405234801562000010575f80fd5b50604051620024343803806200243483398101604081905262000033916200035e565b816001600160a01b03166330504b6f6040518163ffffffff1660e01b8152600401602060405180830381865afa15801562000070573d5f803e3d5ffd5b505050506040513d601f19601f8201168201806040525081019062000096919062000444565b815114620000eb5760405162461bcd60e51b815260206004820152601a60248201527f57726f6e67206e756d626572206f66207265676973747269657300000000000060448201526064015b60405180910390fd5b80516080526001600160a01b03821660a08190526040805163630afce560e01b8152905163630afce5916004808201926020929091908290030181865afa15801562000139573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906200015f91906200045c565b6001600160a01b031660c0525f5b815181101562000317578181815181106200018c576200018c62000481565b60200260200101516001600160a01b0316633d83908a6040518163ffffffff1660e01b8152600401602060405180830381865afa158015620001d0573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190620001f691906200045c565b604051630bc17feb60e01b8152600481018390526001600160a01b0391821691851690630bc17feb90602401602060405180830381865afa1580156200023e573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906200026491906200045c565b6001600160a01b031614620002bc5760405162461bcd60e51b815260206004820152601560248201527f54726f76654d616e61676572206d69736d6174636800000000000000000000006044820152606401620000e2565b5f828281518110620002d257620002d262000481565b6020908102919091018101518254600180820185555f9485529290932090920180546001600160a01b0319166001600160a01b0390931692909217909155016200016d565b50505062000495565b6001600160a01b038116811462000335575f80fd5b50565b634e487b7160e01b5f52604160045260245ffd5b8051620003598162000320565b919050565b5f806040838503121562000370575f80fd5b82516200037d8162000320565b602084810151919350906001600160401b03808211156200039c575f80fd5b818601915086601f830112620003b0575f80fd5b815181811115620003c557620003c562000338565b8060051b604051601f19603f83011681018181108582111715620003ed57620003ed62000338565b6040529182528482019250838101850191898311156200040b575f80fd5b938501935b82851015620004345762000424856200034c565b8452938501939285019262000410565b8096505050505050509250929050565b5f6020828403121562000455575f80fd5b5051919050565b5f602082840312156200046d575f80fd5b81516200047a8162000320565b9392505050565b634e487b7160e01b5f52603260045260245ffd5b60805160a05160c051611ef86200053c5f395f818160ae015281816108ae0152818161094401528181610be80152610c7f01525f8181610137015281816102ae0152818161074c01526109db01525f818160ed015281816101bc01528181610323015281816103a50152818161061d0152818161068e0152818161071001528181610a3e01528181610d0101528181610dc4015281816110ae01526111d50152611ef85ff3fe608060405234801561000f575f80fd5b506004361061007a575f3560e01c8063c8c52fb711610058578063c8c52fb71461011d578063d330fadd14610132578063dfa397d714610159578063edf26d9b1461017a575f80fd5b80632b9f137c1461007e578063630afce5146100a95780636c088de8146100e8575b5f80fd5b61009161008c3660046119f1565b61018d565b6040516100a093929190611a11565b60405180910390f35b6100d07f000000000000000000000000000000000000000000000000000000000000000081565b6040516001600160a01b0390911681526020016100a0565b61010f7f000000000000000000000000000000000000000000000000000000000000000081565b6040519081526020016100a0565b61013061012b366004611ae1565b6105c7565b005b6100d07f000000000000000000000000000000000000000000000000000000000000000081565b61016c6101673660046119f1565b610cfc565b6040516100a0929190611b9e565b6100d0610188366004611c42565b6116fd565b5f8060605f8061019d8787610cfc565b91509150805f036101b5575f809450945050506105c0565b8694505f5b7f0000000000000000000000000000000000000000000000000000000000000000811015610297578281815181106101f4576101f4611c59565b602002602001015160400151801561022857505f83828151811061021a5761021a611c59565b602002602001015160800151115b1561028f575f83828151811061024057610240611c59565b6020026020010151608001518385848151811061025f5761025f611c59565b602002602001015160c001516102759190611c81565b61027f9190611c98565b90508681101561028d578096505b505b6001016101ba565b506040516331f889a760e11b8152600481018690527f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316906363f1134e90602401602060405180830381865afa1580156102fb573d5f803e3d5ffd5b505050506040513d601f19601f8201168201806040525081019061031f9190611cb7565b93507f000000000000000000000000000000000000000000000000000000000000000067ffffffffffffffff81111561035a5761035a611a72565b60405190808252806020026020018201604052801561039e57816020015b604080518082019091525f80825260208201528152602001906001900390816103785790505b5092505f5b7f00000000000000000000000000000000000000000000000000000000000000008110156105bc578281815181106103dd576103dd611c59565b602002602001015160400151801561041157505f83828151811061040357610403611c59565b602002602001015160800151115b156105b4575f80828154811061042957610429611c59565b5f918252602091829020015460408051633a0df78d60e11b815290516001600160a01b039092169263741bef1a926004808401938290030181865afa158015610474573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906104989190611ce5565b6001600160a01b031663b5b65cef6040518163ffffffff1660e01b815260040160408051808303815f875af11580156104d3573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906104f79190611d1b565b5090508284838151811061050d5761050d611c59565b602002602001015160800151886105249190611c81565b61052e9190611c98565b85838151811061054057610540611c59565b6020908102919091010151528061055f87670de0b6b3a7640000611d45565b86848151811061057157610571611c59565b60200260200101515f01516105869190611c81565b6105909190611c98565b8583815181106105a2576105a2611c59565b60200260200101516020018181525050505b6001016103a3565b5050505b9250925092565b5f841161061b5760405162461bcd60e51b815260206004820181905260248201527f52656465656d656420616d6f756e74206d757374206265206e6f6e2d7a65726f60448201526064015b60405180910390fd5b7f000000000000000000000000000000000000000000000000000000000000000081511461068b5760405162461bcd60e51b815260206004820152601d60248201527f57726f6e67205f6d696e436f6c6c52656465656d6564206c656e6774680000006044820152606401610612565b5f7f000000000000000000000000000000000000000000000000000000000000000067ffffffffffffffff8111156106c5576106c5611a72565b60405190808252806020026020018201604052801561070957816020015b604080518082019091525f80825260208201528152602001906001900390816106e35790505b5090505f5b7f000000000000000000000000000000000000000000000000000000000000000081101561089657604051631c96a19760e31b8152600481018290527f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03169063e4b50cb890602401602060405180830381865afa158015610799573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906107bd9190611ce5565b8282815181106107cf576107cf611c59565b60209081029190910101516001600160a01b03909116905281518290829081106107fb576107fb611c59565b6020908102919091010151516040516370a0823160e01b81523060048201526001600160a01b03909116906370a0823190602401602060405180830381865afa15801561084a573d5f803e3d5ffd5b505050506040513d601f19601f8201168201806040525081019061086e9190611cb7565b82828151811061088057610880611c59565b602090810291909101810151015260010161070e565b506040516370a0823160e01b81523060048201525f907f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316906370a0823190602401602060405180830381865afa1580156108fb573d5f803e3d5ffd5b505050506040513d601f19601f8201168201806040525081019061091f9190611cb7565b6040516323b872dd60e01b8152336004820152306024820152604481018890529091507f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316906323b872dd906064016020604051808303815f875af1158015610992573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906109b69190611d58565b5060405163ab6d53bd60e01b81526004810187905260248101869052604481018590527f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03169063ab6d53bd906064015f604051808303815f87803b158015610a24575f80fd5b505af1158015610a36573d5f803e3d5ffd5b505050505f5b7f0000000000000000000000000000000000000000000000000000000000000000811015610bc6575f838281518110610a7757610a77611c59565b602002602001015160200151848381518110610a9557610a95611c59565b6020908102919091010151516040516370a0823160e01b81523060048201526001600160a01b03909116906370a0823190602401602060405180830381865afa158015610ae4573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190610b089190611cb7565b610b129190611d45565b9050848281518110610b2657610b26611c59565b6020026020010151811015610b7d5760405162461bcd60e51b815260206004820181905260248201527f496e73756666696369656e7420636f6c6c61746572616c2072656465656d65646044820152606401610612565b8015610bbd57610bbd3382868581518110610b9a57610b9a611c59565b60200260200101515f01516001600160a01b03166117249092919063ffffffff16565b50600101610a3c565b506040516370a0823160e01b81523060048201525f9082906001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016906370a0823190602401602060405180830381865afa158015610c2d573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190610c519190611cb7565b610c5b9190611d45565b90508015610cf35760405163a9059cbb60e01b8152336004820152602481018290527f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03169063a9059cbb906044016020604051808303815f875af1158015610ccd573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190610cf19190611d58565b505b50505050505050565b60605f7f000000000000000000000000000000000000000000000000000000000000000067ffffffffffffffff811115610d3857610d38611a72565b604051908082528060200260200182016040528015610dbd57816020015b610daa6040518061010001604052805f6001600160a01b031681526020015f6001600160a01b031681526020015f151581526020015f81526020015f81526020015f81526020015f81526020015f81525090565b815260200190600190039081610d565790505b5091505f5b7f000000000000000000000000000000000000000000000000000000000000000081101561108b575f8181548110610dfc57610dfc611c59565b5f918252602091829020015460408051631ec1c84560e11b815290516001600160a01b0390921692633d83908a926004808401938290030181865afa158015610e47573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190610e6b9190611ce5565b838281518110610e7d57610e7d611c59565b60209081029190910101516001600160a01b0390911690525f805482908110610ea857610ea8611c59565b5f918252602091829020015460408051632ba461d560e21b815290516001600160a01b039092169263ae918754926004808401938290030181865afa158015610ef3573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190610f179190611ce5565b838281518110610f2957610f29611c59565b6020026020010151602001906001600160a01b031690816001600160a01b031681525050828181518110610f5f57610f5f611c59565b60200260200101515f01516001600160a01b0316634ea15f376040518163ffffffff1660e01b81526004016060604051808303815f875af1158015610fa6573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190610fca9190611d71565b858481518110610fdc57610fdc611c59565b6020026020010151608001868581518110610ff957610ff9611c59565b602002602001015160600187868151811061101657611016611c59565b60200260200101516040018315151515815250838152508381525050505082818151811061104657611046611c59565b602002602001015160400151156110835782818151811061106957611069611c59565b602002602001015160800151826110809190611da3565b91505b600101610dc2565b50805f10801561109a57508381105b156110a3578093505b805f036111cb575f5b7f00000000000000000000000000000000000000000000000000000000000000008110156111c9578281815181106110e6576110e6611c59565b60200260200101515f01516001600160a01b031663105b403b6040518163ffffffff1660e01b8152600401602060405180830381865afa15801561112c573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906111509190611cb7565b83828151811061116257611162611c59565b6020026020010151608001818152505082818151811061118457611184611c59565b602002602001015160400151156111c1578281815181106111a7576111a7611c59565b602002602001015160800151826111be9190611da3565b91505b6001016110ac565b505b80156116f6575f5b7f00000000000000000000000000000000000000000000000000000000000000008110156116f45782818151811061120d5761120d611c59565b602002602001015160400151156116ec578183828151811061123157611231611c59565b602002602001015160800151866112489190611c81565b6112529190611c98565b83828151811061126457611264611c59565b602002602001015160a001818152505082818151811061128657611286611c59565b602002602001015160a001515f03156116ec575f8382815181106112ac576112ac611c59565b60200260200101515f01516001600160a01b031663015402876040518163ffffffff1660e01b8152600401602060405180830381865afa1580156112f2573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906113169190611cb7565b90505f84838151811061132b5761132b611c59565b6020026020010151602001516001600160a01b0316634d6228316040518163ffffffff1660e01b8152600401602060405180830381865afa158015611372573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906113969190611cb7565b90505f80835f0361143157828786815181106113b4576113b4611c59565b6020026020010151602001516001600160a01b0316631037a5f4856040518263ffffffff1660e01b81526004016113ed91815260200190565b602060405180830381865afa158015611408573d5f803e3d5ffd5b505050506040513d601f19601f8201168201806040525081019061142c9190611cb7565b611434565b83835b915091505f87868151811061144b5761144b611c59565b602002602001015160e00181815250505b8787868151811061146f5761146f611c59565b602002602001015160e001511080611485575087155b156116e75786858151811061149c5761149c611c59565b602002602001015160a001518786815181106114ba576114ba611c59565b602002602001015160c0015114806114d0575081155b6116e7575f8786815181106114e7576114e7611c59565b60200260200101515f01516001600160a01b031663aad3f404846040518263ffffffff1660e01b815260040161151f91815260200190565b61014060405180830381865afa15801561153b573d5f803e3d5ffd5b505050506040513d601f19601f8201168201806040525081019061155f9190611db6565b9050670de0b6b3a7640000815f015189888151811061158057611580611c59565b602002602001015160600151836020015161159b9190611c81565b6115a59190611c98565b10611628576115fa8887815181106115bf576115bf611c59565b602002602001015160c001518988815181106115dd576115dd611c59565b602002602001015160a001516115f39190611d45565b825161177b565b88878151811061160c5761160c611c59565b602002602001015160c0018181516116249190611da3565b9052505b81925087868151811061163d5761163d611c59565b6020026020010151602001516001600160a01b0316631037a5f4836040518263ffffffff1660e01b815260040161167691815260200190565b602060405180830381865afa158015611691573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906116b59190611cb7565b9150508685815181106116ca576116ca611c59565b602002602001015160e00180516116e090611e3b565b905261145c565b505050505b6001016111d3565b505b9250929050565b5f818154811061170b575f80fd5b5f918252602090912001546001600160a01b0316905081565b604080516001600160a01b038416602482015260448082018490528251808303909101815260649091019091526020810180516001600160e01b031663a9059cbb60e01b179052611776908490611794565b505050565b5f818310611789578161178b565b825b90505b92915050565b5f6117e8826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b03166118679092919063ffffffff16565b905080515f14806118085750808060200190518101906118089190611d58565b6117765760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6044820152691bdd081cdd58d8d9595960b21b6064820152608401610612565b606061187584845f8561187d565b949350505050565b6060824710156118de5760405162461bcd60e51b815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f6044820152651c8818d85b1b60d21b6064820152608401610612565b5f80866001600160a01b031685876040516118f99190611e75565b5f6040518083038185875af1925050503d805f8114611933576040519150601f19603f3d011682016040523d82523d5f602084013e611938565b606091505b509150915061194987838387611954565b979650505050505050565b606083156119c25782515f036119bb576001600160a01b0385163b6119bb5760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e74726163740000006044820152606401610612565b5081611875565b61187583838151156119d75781518083602001fd5b8060405162461bcd60e51b81526004016106129190611e90565b5f8060408385031215611a02575f80fd5b50508035926020909101359150565b5f6060820185835260208560208501526040606060408601528286518085526080870191506020880194505f5b81811015611a6357855180518452850151858401529484019491830191600101611a3e565b50909998505050505050505050565b634e487b7160e01b5f52604160045260245ffd5b604051610140810167ffffffffffffffff81118282101715611aaa57611aaa611a72565b60405290565b604051601f8201601f1916810167ffffffffffffffff81118282101715611ad957611ad9611a72565b604052919050565b5f805f8060808587031215611af4575f80fd5b84359350602080860135935060408601359250606086013567ffffffffffffffff80821115611b21575f80fd5b818801915088601f830112611b34575f80fd5b813581811115611b4657611b46611a72565b8060051b9150611b57848301611ab0565b818152918301840191848101908b841115611b70575f80fd5b938501935b83851015611b8e57843582529385019390850190611b75565b989b979a50959850505050505050565b604080825283518282018190525f9190606090818501906020808901865b83811015611c2b57815180516001600160a01b0390811687528482015116848701528781015115158887015286810151878701526080808201519087015260a0808201519087015260c0808201519087015260e090810151908601526101009094019390820190600101611bbc565b505050508093505050508260208301529392505050565b5f60208284031215611c52575f80fd5b5035919050565b634e487b7160e01b5f52603260045260245ffd5b634e487b7160e01b5f52601160045260245ffd5b808202811582820484141761178e5761178e611c6d565b5f82611cb257634e487b7160e01b5f52601260045260245ffd5b500490565b5f60208284031215611cc7575f80fd5b5051919050565b6001600160a01b0381168114611ce2575f80fd5b50565b5f60208284031215611cf5575f80fd5b8151611d0081611cce565b9392505050565b80518015158114611d16575f80fd5b919050565b5f8060408385031215611d2c575f80fd5b82519150611d3c60208401611d07565b90509250929050565b8181038181111561178e5761178e611c6d565b5f60208284031215611d68575f80fd5b61178b82611d07565b5f805f60608486031215611d83575f80fd5b8351925060208401519150611d9a60408501611d07565b90509250925092565b8082018082111561178e5761178e611c6d565b5f6101408284031215611dc7575f80fd5b611dcf611a86565b825181526020830151602082015260408301516040820152606083015160608201526080830151608082015260a083015160a082015260c083015160c082015260e083015160e08201526101008084015181830152506101208084015181830152508091505092915050565b5f60018201611e4c57611e4c611c6d565b5060010190565b5f5b83811015611e6d578181015183820152602001611e55565b50505f910152565b5f8251611e86818460208701611e53565b9190910192915050565b602081525f8251806020840152611eae816040850160208701611e53565b601f01601f1916919091016040019291505056fea264697066735822122003eb4c9aef9f87887838b06a3da359c8b884fbbaaac8334fcaad45fd78facaca64736f6c63430008180033000000000000000000000000fae08e80e0598ebecb8a3acf0eb8f85922e7cae1000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000030000000000000000000000000dbcb1229b43b1d2fe0b63235bf64e7c8034b98e000000000000000000000000839017ef9366c7a1b094e8cce1bf45fccca5c55a000000000000000000000000b847b61a58b103dc3163091a294c8f270cd6df0a", + "nonce": "0x1f2", + "chainId": "0xaa36a7" + }, + "additionalContracts": [], + "isFixedGasLimit": false + } + ], + "receipts": [ + { + "status": "0x1", + "cumulativeGasUsed": "0x1a1c701", + "logs": [], + "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "type": "0x2", + "transactionHash": "0x4fa985964bb99247035251efeaa94e88697c47c410fb5d23b3db4b58b96223fd", + "transactionIndex": "0x51", + "blockHash": "0xb15949a0e95feb80a4d0a0bc70f1225f844efc78173187d87f055479fc0ff717", + "blockNumber": "0x916309", + "gasUsed": "0x1cead6", + "effectiveGasPrice": "0xf424a", + "from": "0xb32073560ba0a715497886d4a4dd83ee9be71390", + "to": null, + "contractAddress": "0xf299f3c504904c5f0b67f0ea0caf745d8912dc45" + } + ], + "libraries": [], + "pending": [], + "returns": {}, + "timestamp": 1761890347448, + "chain": 11155111, + "commit": "95c3b609" +} \ No newline at end of file diff --git a/contracts/script/DeployLiquity2.s.sol b/contracts/script/DeployLiquity2.s.sol index 75651ed6b..eeabbedc0 100644 --- a/contracts/script/DeployLiquity2.s.sol +++ b/contracts/script/DeployLiquity2.s.sol @@ -23,6 +23,7 @@ import "src/GasPool.sol"; import "src/HintHelpers.sol"; import "src/MultiTroveGetter.sol"; import {DebtInFrontHelper, IDebtInFrontHelper} from "src/DebtInFrontHelper.sol"; +import {RedemptionHelper, IRedemptionHelper} from "src/RedemptionHelper.sol"; import "src/SortedTroves.sol"; import "src/StabilityPool.sol"; import "src/PriceFeeds/WETHPriceFeed.sol"; @@ -227,6 +228,7 @@ contract DeployLiquity2Script is DeployGovernance, UniPriceConverter, StdCheats, IDebtInFrontHelper debtInFrontHelper; IExchangeHelpers exchangeHelpers; IExchangeHelpersV2 exchangeHelpersV2; + IRedemptionHelper redemptionHelper; } function run() external { @@ -655,6 +657,8 @@ contract DeployLiquity2Script is DeployGovernance, UniPriceConverter, StdCheats, _feeWethColl: UNIV3_FEE_WETH_COLL, _uniV3Quoter: uniV3Quoter }); + + r.redemptionHelper = new RedemptionHelper(r.collateralRegistry, vars.addressesRegistries); } function _deployAddressesRegistry(TroveManagerParams memory _troveManagerParams) @@ -1180,6 +1184,7 @@ contract DeployLiquity2Script is DeployGovernance, UniPriceConverter, StdCheats, string.concat('"exchangeHelpersV2":"', address(deployed.exchangeHelpersV2).toHexString(), '",') ), string.concat( + string.concat('"redemptionHelper":"', address(deployed.redemptionHelper).toHexString(), '",'), string.concat('"branches":[', branches.join(","), "],"), string.concat('"governance":', _governanceManifest, "") // no comma ), diff --git a/contracts/script/DeployRedemptionHelper.s.sol b/contracts/script/DeployRedemptionHelper.s.sol new file mode 100644 index 000000000..b5bcfa2a3 --- /dev/null +++ b/contracts/script/DeployRedemptionHelper.s.sol @@ -0,0 +1,32 @@ +// SPDX-License-Identifier: UNLICENSED +pragma solidity 0.8.24; + +import {console} from "forge-std/console.sol"; +import {Script} from "forge-std/Script.sol"; +import {Strings} from "openzeppelin-contracts/contracts/utils/Strings.sol"; +import {IAddressesRegistry} from "../src/Interfaces/IAddressesRegistry.sol"; +import {RedemptionHelper} from "../src/RedemptionHelper.sol"; +import {UseDeployment} from "../test/Utils/UseDeployment.sol"; + +contract DeployRedemptionHelper is Script, UseDeployment { + using Strings for *; + + function run() external { + if (block.chainid != 1 && block.chainid != 11155111) { + revert("Unsupported chain"); + } + + _loadDeploymentFromManifest(string.concat("addresses/", block.chainid.toString(), ".json")); + + IAddressesRegistry[] memory addresses = new IAddressesRegistry[](branches.length); + for (uint256 i = 0; i < branches.length; ++i) { + addresses[i] = branches[i].addressesRegistry; + } + + vm.startBroadcast(); + RedemptionHelper redemptionHelper = + new RedemptionHelper({_collateralRegistry: collateralRegistry, _addresses: addresses}); + + console.log("redemptionHelper:", address(redemptionHelper)); + } +} diff --git a/frontend/app/.env b/frontend/app/.env index c49ed2a5d..7e68802ae 100644 --- a/frontend/app/.env +++ b/frontend/app/.env @@ -121,6 +121,7 @@ NEXT_PUBLIC_CONTRACT_LQTY_STAKING=0x4f9fbb3f1e99b56e0fe2892e623ed36a76fc605d NEXT_PUBLIC_CONTRACT_LQTY_TOKEN=0x6dea81c8171d0ba574754ef6f8b412f2ed88c54d NEXT_PUBLIC_CONTRACT_LUSD_TOKEN=0x5f98805a4e8be255a32880fdec7f6728c6568ba0 NEXT_PUBLIC_CONTRACT_MULTI_TROVE_GETTER=0xfa61db085510c64b83056db3a7acf3b6f631d235 +NEXT_PUBLIC_CONTRACT_REDEMPTION_HELPER=0x0000000000000000000000000000000000000000 NEXT_PUBLIC_CONTRACT_WETH=0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2 ########### @@ -197,6 +198,7 @@ NEXT_PUBLIC_CONTRACT_WETH=0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2 # NEXT_PUBLIC_CONTRACT_LQTY_TOKEN=0x13e5b79dfa0408a2e93b531e5031e5f1a6b4d039 # NEXT_PUBLIC_CONTRACT_LUSD_TOKEN=0x8472e818fad7b22e009c45c6b35dbf582c39caca # NEXT_PUBLIC_CONTRACT_MULTI_TROVE_GETTER=0x19303bc4d3518039d0780a55e9950b222b178467 +# NEXT_PUBLIC_CONTRACT_REDEMPTION_HELPER=0xf299f3c504904c5f0b67f0ea0caf745d8912dc45 # NEXT_PUBLIC_CONTRACT_WETH=0x5a490cefab14d9479ca6a63cb9d8d17c8785fbcb ########################### diff --git a/frontend/app/scripts/update-liquity-abis.ts b/frontend/app/scripts/update-liquity-abis.ts index 631358ea6..f92cc6c98 100644 --- a/frontend/app/scripts/update-liquity-abis.ts +++ b/frontend/app/scripts/update-liquity-abis.ts @@ -17,6 +17,7 @@ const ABIS = [ ["MultiTroveGetter"], ["DebtInFrontHelper"], ["IExchangeHelpersV2"], + ["RedemptionHelper"], // Governance (V2-gov lib) ["Governance"], diff --git a/frontend/app/src/abi/BribeInitiative.ts b/frontend/app/src/abi/BribeInitiative.ts index e6cae79a9..24dd5bff9 100644 --- a/frontend/app/src/abi/BribeInitiative.ts +++ b/frontend/app/src/abi/BribeInitiative.ts @@ -106,11 +106,12 @@ export const BribeInitiative = [ "type": "uint256", "internalType": "uint256", }], - "outputs": [{ "name": "", "type": "uint256", "internalType": "uint256" }, { - "name": "", - "type": "uint256", - "internalType": "uint256", - }], + "outputs": [ + { "name": "", "type": "uint256", "internalType": "uint256" }, + { "name": "", "type": "uint256", "internalType": "uint256" }, + { "name": "", "type": "uint256", "internalType": "uint256" }, + { "name": "", "type": "uint256", "internalType": "uint256" }, + ], "stateMutability": "view", }, { @@ -185,11 +186,12 @@ export const BribeInitiative = [ "type": "function", "name": "totalLQTYAllocatedByEpoch", "inputs": [{ "name": "_epoch", "type": "uint256", "internalType": "uint256" }], - "outputs": [{ "name": "", "type": "uint256", "internalType": "uint256" }, { - "name": "", - "type": "uint256", - "internalType": "uint256", - }], + "outputs": [ + { "name": "", "type": "uint256", "internalType": "uint256" }, + { "name": "", "type": "uint256", "internalType": "uint256" }, + { "name": "", "type": "uint256", "internalType": "uint256" }, + { "name": "", "type": "uint256", "internalType": "uint256" }, + ], "stateMutability": "view", }, { diff --git a/frontend/app/src/abi/RedemptionHelper.ts b/frontend/app/src/abi/RedemptionHelper.ts new file mode 100644 index 000000000..e10aaba77 --- /dev/null +++ b/frontend/app/src/abi/RedemptionHelper.ts @@ -0,0 +1,93 @@ +// this file was generated by scripts/update-liquity-abis.ts +// please do not edit it manually +export const RedemptionHelper = [{ + "type": "constructor", + "inputs": [{ "name": "_collateralRegistry", "type": "address", "internalType": "contract ICollateralRegistry" }, { + "name": "_addresses", + "type": "address[]", + "internalType": "contract IAddressesRegistry[]", + }], + "stateMutability": "nonpayable", +}, { + "type": "function", + "name": "addresses", + "inputs": [{ "name": "", "type": "uint256", "internalType": "uint256" }], + "outputs": [{ "name": "", "type": "address", "internalType": "contract IAddressesRegistry" }], + "stateMutability": "view", +}, { + "type": "function", + "name": "boldToken", + "inputs": [], + "outputs": [{ "name": "", "type": "address", "internalType": "contract IBoldToken" }], + "stateMutability": "view", +}, { + "type": "function", + "name": "collateralRegistry", + "inputs": [], + "outputs": [{ "name": "", "type": "address", "internalType": "contract ICollateralRegistry" }], + "stateMutability": "view", +}, { + "type": "function", + "name": "numBranches", + "inputs": [], + "outputs": [{ "name": "", "type": "uint256", "internalType": "uint256" }], + "stateMutability": "view", +}, { + "type": "function", + "name": "redeemCollateral", + "inputs": [ + { "name": "_bold", "type": "uint256", "internalType": "uint256" }, + { "name": "_maxIterationsPerCollateral", "type": "uint256", "internalType": "uint256" }, + { "name": "_maxFeePct", "type": "uint256", "internalType": "uint256" }, + { "name": "_minCollRedeemed", "type": "uint256[]", "internalType": "uint256[]" }, + ], + "outputs": [], + "stateMutability": "nonpayable", +}, { + "type": "function", + "name": "simulateRedemption", + "inputs": [{ "name": "_bold", "type": "uint256", "internalType": "uint256" }, { + "name": "_maxIterationsPerCollateral", + "type": "uint256", + "internalType": "uint256", + }], + "outputs": [{ + "name": "branch", + "type": "tuple[]", + "internalType": "struct IRedemptionHelper.SimulationContext[]", + "components": [ + { "name": "troveManager", "type": "address", "internalType": "address" }, + { "name": "sortedTroves", "type": "address", "internalType": "address" }, + { "name": "redeemable", "type": "bool", "internalType": "bool" }, + { "name": "price", "type": "uint256", "internalType": "uint256" }, + { "name": "proportion", "type": "uint256", "internalType": "uint256" }, + { "name": "attemptedBold", "type": "uint256", "internalType": "uint256" }, + { "name": "redeemedBold", "type": "uint256", "internalType": "uint256" }, + { "name": "iterations", "type": "uint256", "internalType": "uint256" }, + ], + }, { "name": "totalProportions", "type": "uint256", "internalType": "uint256" }], + "stateMutability": "nonpayable", +}, { + "type": "function", + "name": "truncateRedemption", + "inputs": [{ "name": "_bold", "type": "uint256", "internalType": "uint256" }, { + "name": "_maxIterationsPerCollateral", + "type": "uint256", + "internalType": "uint256", + }], + "outputs": [{ "name": "truncatedBold", "type": "uint256", "internalType": "uint256" }, { + "name": "feePct", + "type": "uint256", + "internalType": "uint256", + }, { + "name": "redeemed", + "type": "tuple[]", + "internalType": "struct IRedemptionHelper.Redeemed[]", + "components": [{ "name": "bold", "type": "uint256", "internalType": "uint256" }, { + "name": "coll", + "type": "uint256", + "internalType": "uint256", + }], + }], + "stateMutability": "nonpayable", +}] as const; diff --git a/frontend/app/src/contracts.ts b/frontend/app/src/contracts.ts index d5cdf76f9..23d9a1cae 100644 --- a/frontend/app/src/contracts.ts +++ b/frontend/app/src/contracts.ts @@ -17,6 +17,7 @@ import { LqtyStaking } from "@/src/abi/LqtyStaking"; import { LqtyToken } from "@/src/abi/LqtyToken"; import { MultiTroveGetter } from "@/src/abi/MultiTroveGetter"; import { PriceFeed } from "@/src/abi/PriceFeed"; +import { RedemptionHelper } from "@/src/abi/RedemptionHelper"; import { SortedTroves } from "@/src/abi/SortedTroves"; import { StabilityPool } from "@/src/abi/StabilityPool"; import { TroveManager } from "@/src/abi/TroveManager"; @@ -33,6 +34,7 @@ import { CONTRACT_LQTY_TOKEN, CONTRACT_LUSD_TOKEN, CONTRACT_MULTI_TROVE_GETTER, + CONTRACT_REDEMPTION_HELPER, CONTRACT_WETH, ENV_BRANCHES, } from "@/src/env"; @@ -50,6 +52,7 @@ const protocolAbis = { LqtyToken, LusdToken: erc20Abi, MultiTroveGetter, + RedemptionHelper, WETH: erc20Abi, } as const; @@ -141,6 +144,10 @@ export const CONTRACTS: Contracts = { abi: abis.MultiTroveGetter, address: CONTRACT_MULTI_TROVE_GETTER, }, + RedemptionHelper: { + abi: abis.RedemptionHelper, + address: CONTRACT_REDEMPTION_HELPER, + }, WETH: { abi: abis.WETH, address: CONTRACT_WETH }, branches: ENV_BRANCHES.map(({ branchId, symbol, contracts }) => ({ id: branchId, diff --git a/frontend/app/src/env.ts b/frontend/app/src/env.ts index 90ae2bf40..c76a64591 100644 --- a/frontend/app/src/env.ts +++ b/frontend/app/src/env.ts @@ -207,6 +207,7 @@ export const EnvSchema = v.pipe( CONTRACT_LQTY_TOKEN: vAddress(), CONTRACT_LUSD_TOKEN: vAddress(), CONTRACT_MULTI_TROVE_GETTER: vAddress(), + CONTRACT_REDEMPTION_HELPER: vAddress(), CONTRACT_WETH: vAddress(), ...vBranchEnvVars(0).entries, @@ -367,6 +368,7 @@ const parsedEnv = v.safeParse(EnvSchema, { CONTRACT_LQTY_TOKEN: process.env.NEXT_PUBLIC_CONTRACT_LQTY_TOKEN, CONTRACT_LUSD_TOKEN: process.env.NEXT_PUBLIC_CONTRACT_LUSD_TOKEN, CONTRACT_MULTI_TROVE_GETTER: process.env.NEXT_PUBLIC_CONTRACT_MULTI_TROVE_GETTER, + CONTRACT_REDEMPTION_HELPER: process.env.NEXT_PUBLIC_CONTRACT_REDEMPTION_HELPER, CONTRACT_WETH: process.env.NEXT_PUBLIC_CONTRACT_WETH, COLL_0_TOKEN_ID: process.env.NEXT_PUBLIC_COLL_0_TOKEN_ID, @@ -458,6 +460,7 @@ export const { CONTRACT_LQTY_TOKEN, CONTRACT_LUSD_TOKEN, CONTRACT_MULTI_TROVE_GETTER, + CONTRACT_REDEMPTION_HELPER, CONTRACT_WETH, DEPLOYMENT_FLAVOR, KNOWN_DELEGATES_URL,