linted code

This commit is contained in:
Richa-iitr 2022-04-04 02:01:04 +05:30
parent bc12131ccf
commit b859ad49e6
3 changed files with 72 additions and 52 deletions

View File

@ -239,8 +239,16 @@ contract AaveHelpers is Helper {
bytes32[] memory s,
uint256[] memory expiry
) internal {
for(uint256 i = 0; i < tokens.length; i++) {
aTokenContracts[i].permit(userAccount, address(this), uint(-1), expiry[i], v[i], r[i], s[i]);
for (uint256 i = 0; i < tokens.length; i++) {
aTokenContracts[i].permit(
userAccount,
address(this),
uint256(-1),
expiry[i],
v[i],
r[i],
s[i]
);
}
}

View File

@ -111,12 +111,20 @@ contract AaveV3ImportPermitResolver is AaveHelpers {
* @param inputData The struct containing all the neccessary input data
* @param permitData The struct containing signed permit data like v,r,s,expiry
*/
function importAave(address userAccount, ImportInputData memory inputData, signedPermits memory permitData)
function importAave(
address userAccount,
ImportInputData memory inputData,
signedPermits memory permitData
)
external
payable
returns (string memory _eventName, bytes memory _eventParam)
{
(_eventName, _eventParam) = _importAave(userAccount, inputData, permitData);
(_eventName, _eventParam) = _importAave(
userAccount,
inputData,
permitData
);
}
}

View File

@ -31,83 +31,83 @@ const mnemonic = "test test test test test test test test test test test junk";
const erc20Abi = [
{
"constant": false,
"inputs": [
constant: false,
inputs: [
{
"name": "_spender",
"type": "address"
name: "_spender",
type: "address"
},
{
"name": "_value",
"type": "uint256"
name: "_value",
type: "uint256"
}
],
"name": "approve",
"outputs": [
name: "approve",
outputs: [
{
"name": "",
"type": "bool"
name: "",
type: "bool"
}
],
"payable": false,
"stateMutability": "nonpayable",
"type": "function"
payable: false,
stateMutability: "nonpayable",
type: "function"
},
{
"constant": true,
"inputs": [],
"name": "totalSupply",
"outputs": [
constant: true,
inputs: [],
name: "totalSupply",
outputs: [
{
"name": "",
"type": "uint256"
name: "",
type: "uint256"
}
],
"payable": false,
"stateMutability": "view",
"type": "function"
payable: false,
stateMutability: "view",
type: "function"
},
{
"constant": true,
"inputs": [
constant: true,
inputs: [
{
"name": "_owner",
"type": "address"
name: "_owner",
type: "address"
}
],
"name": "balanceOf",
"outputs": [
name: "balanceOf",
outputs: [
{
"name": "balance",
"type": "uint256"
name: "balance",
type: "uint256"
}
],
"payable": false,
"stateMutability": "view",
"type": "function"
payable: false,
stateMutability: "view",
type: "function"
},
{
"constant": false,
"inputs": [
constant: false,
inputs: [
{
"name": "_to",
"type": "address"
name: "_to",
type: "address"
},
{
"name": "_value",
"type": "uint256"
name: "_value",
type: "uint256"
}
],
"name": "transfer",
"outputs": [
name: "transfer",
outputs: [
{
"name": "",
"type": "bool"
name: "",
type: "bool"
}
],
"payable": false,
"stateMutability": "nonpayable",
"type": "function"
payable: false,
stateMutability: "nonpayable",
type: "function"
}
];
@ -304,7 +304,7 @@ describe("Import Aave", function () {
it("Should migrate Aave position", async () => {
const DOMAIN_SEPARATOR = await aDai.connect(wallet0).DOMAIN_SEPARATOR();
const PERMIT_TYPEHASH = "0x6e71edae12b1b97f4d1f60370fef10105fa2faae0126114a169c64845d6126c9";
let nonce = (await aDai.connect(wallet0).nonces(wallet.address)).toNumber();
//Approving max amount
const amount = ethers.constants.MaxUint256;
@ -335,7 +335,11 @@ describe("Import Aave", function () {
{
connector: "AAVE-V3-IMPORT-PERMIT-X",
method: "importAave",
args: [wallet.address, [[DAI], [USDC], false, [amountB.toFixed(0)]], [[ethers.utils.hexlify(v)], [ethers.utils.hexlify(r)], [ethers.utils.hexlify(s)], [expiry]]]
args: [
wallet.address,
[[DAI], [USDC], false, [amountB.toFixed(0)]],
[[ethers.utils.hexlify(v)], [ethers.utils.hexlify(r)], [ethers.utils.hexlify(s)], [expiry]]
]
},
{
connector: "INSTAPOOL-C",