Skip to content

Commit

Permalink
Aave repay workflow fix (#315)
Browse files Browse the repository at this point in the history
* Refactor AaveRepayWorkflow by removing onBehalfOf parameter, updating tests accordingly, and changing testGetAccountData_BeforeLending to a view function.

* Add Bridger integration to AaveBorrowWorkflow with new borrowAndBridge function and update related tests.

* Upgrade access protocol: replace AaveLendWorkflow and AaveWithdrawWorkflow with AaveBorrowWorkflow and AaveRepayWorkflow, update contract addresses and transaction details across multiple chains, and remove redundant workflow checks in migration script.

* Added new functions and error types to JSON artifacts, updated contract addresses, and modified the deployment script to include new workflows and ensure proper workflow registration.

* Refactor migration script to use startBroadcast and stopBroadcast for workflow registration.
  • Loading branch information
ylv-io authored Nov 18, 2024
1 parent 56f88cd commit 1967af3
Show file tree
Hide file tree
Showing 18 changed files with 1,231 additions and 169 deletions.
131 changes: 124 additions & 7 deletions artifacts/1.json
Original file line number Diff line number Diff line change
Expand Up @@ -1043,6 +1043,11 @@
"name": "poolAddressProvider_",
"type": "address",
"internalType": "address"
},
{
"name": "bridger_",
"type": "address",
"internalType": "address"
}
],
"stateMutability": "nonpayable"
Expand All @@ -1065,6 +1070,85 @@
"outputs": [],
"stateMutability": "nonpayable"
},
{
"type": "function",
"name": "borrowAndBridge",
"inputs": [
{
"name": "asset",
"type": "address",
"internalType": "address"
},
{
"name": "amount",
"type": "uint256",
"internalType": "uint256"
},
{
"name": "kintoWallet",
"type": "address",
"internalType": "address"
},
{
"name": "bridgeData",
"type": "tuple",
"internalType": "struct IBridger.BridgeData",
"components": [
{
"name": "vault",
"type": "address",
"internalType": "address"
},
{
"name": "gasFee",
"type": "uint256",
"internalType": "uint256"
},
{
"name": "msgGasLimit",
"type": "uint256",
"internalType": "uint256"
},
{
"name": "connector",
"type": "address",
"internalType": "address"
},
{
"name": "execPayload",
"type": "bytes",
"internalType": "bytes"
},
{
"name": "options",
"type": "bytes",
"internalType": "bytes"
}
]
}
],
"outputs": [
{
"name": "amountOut",
"type": "uint256",
"internalType": "uint256"
}
],
"stateMutability": "payable"
},
{
"type": "function",
"name": "bridger",
"inputs": [],
"outputs": [
{
"name": "",
"type": "address",
"internalType": "contract IBridger"
}
],
"stateMutability": "view"
},
{
"type": "function",
"name": "poolAddressProvider",
Expand All @@ -1077,9 +1161,47 @@
}
],
"stateMutability": "view"
},
{
"type": "error",
"name": "AddressEmptyCode",
"inputs": [
{
"name": "target",
"type": "address",
"internalType": "address"
}
]
},
{
"type": "error",
"name": "AddressInsufficientBalance",
"inputs": [
{
"name": "account",
"type": "address",
"internalType": "address"
}
]
},
{
"type": "error",
"name": "FailedInnerCall",
"inputs": []
},
{
"type": "error",
"name": "SafeERC20FailedOperation",
"inputs": [
{
"name": "token",
"type": "address",
"internalType": "address"
}
]
}
],
"address": "0x5bcA84441bfA911b1637A1b2344198dFaCbdCaA1"
"address": "0x8c13D7aDD034A9E1bD8280225Efab7584c5E85A6"
},
"AaveLendWorkflow": {
"abi": [
Expand Down Expand Up @@ -1205,11 +1327,6 @@
"name": "amount",
"type": "uint256",
"internalType": "uint256"
},
{
"name": "onBehalfOf",
"type": "address",
"internalType": "address"
}
],
"outputs": [
Expand Down Expand Up @@ -1260,7 +1377,7 @@
]
}
],
"address": "0x5e4cB8F8E70FBe315EA76323f16410B40151fe3b"
"address": "0x5aAdFB43eF8dAF45DD80F4676345b7676f1D70e3"
},
"AaveWithdrawWorkflow": {
"abi": [
Expand Down
131 changes: 124 additions & 7 deletions artifacts/42161.json
Original file line number Diff line number Diff line change
Expand Up @@ -1043,6 +1043,11 @@
"name": "poolAddressProvider_",
"type": "address",
"internalType": "address"
},
{
"name": "bridger_",
"type": "address",
"internalType": "address"
}
],
"stateMutability": "nonpayable"
Expand All @@ -1065,6 +1070,85 @@
"outputs": [],
"stateMutability": "nonpayable"
},
{
"type": "function",
"name": "borrowAndBridge",
"inputs": [
{
"name": "asset",
"type": "address",
"internalType": "address"
},
{
"name": "amount",
"type": "uint256",
"internalType": "uint256"
},
{
"name": "kintoWallet",
"type": "address",
"internalType": "address"
},
{
"name": "bridgeData",
"type": "tuple",
"internalType": "struct IBridger.BridgeData",
"components": [
{
"name": "vault",
"type": "address",
"internalType": "address"
},
{
"name": "gasFee",
"type": "uint256",
"internalType": "uint256"
},
{
"name": "msgGasLimit",
"type": "uint256",
"internalType": "uint256"
},
{
"name": "connector",
"type": "address",
"internalType": "address"
},
{
"name": "execPayload",
"type": "bytes",
"internalType": "bytes"
},
{
"name": "options",
"type": "bytes",
"internalType": "bytes"
}
]
}
],
"outputs": [
{
"name": "amountOut",
"type": "uint256",
"internalType": "uint256"
}
],
"stateMutability": "payable"
},
{
"type": "function",
"name": "bridger",
"inputs": [],
"outputs": [
{
"name": "",
"type": "address",
"internalType": "contract IBridger"
}
],
"stateMutability": "view"
},
{
"type": "function",
"name": "poolAddressProvider",
Expand All @@ -1077,9 +1161,47 @@
}
],
"stateMutability": "view"
},
{
"type": "error",
"name": "AddressEmptyCode",
"inputs": [
{
"name": "target",
"type": "address",
"internalType": "address"
}
]
},
{
"type": "error",
"name": "AddressInsufficientBalance",
"inputs": [
{
"name": "account",
"type": "address",
"internalType": "address"
}
]
},
{
"type": "error",
"name": "FailedInnerCall",
"inputs": []
},
{
"type": "error",
"name": "SafeERC20FailedOperation",
"inputs": [
{
"name": "token",
"type": "address",
"internalType": "address"
}
]
}
],
"address": "0xAa6a97b31D38892E4Edb183588df6b9b633a71b7"
"address": "0xD0187Ca378f7B26D53e0A91fBe8D7ba80498EF10"
},
"AaveLendWorkflow": {
"abi": [
Expand Down Expand Up @@ -1205,11 +1327,6 @@
"name": "amount",
"type": "uint256",
"internalType": "uint256"
},
{
"name": "onBehalfOf",
"type": "address",
"internalType": "address"
}
],
"outputs": [
Expand Down Expand Up @@ -1260,7 +1377,7 @@
]
}
],
"address": "0x5cC25cc25bE29d18472E76b2a19975aA1a37Bd5C"
"address": "0x5aAdFB43eF8dAF45DD80F4676345b7676f1D70e3"
},
"AaveWithdrawWorkflow": {
"abi": [
Expand Down
Loading

0 comments on commit 1967af3

Please sign in to comment.