mirror of
https://github.com/Instadapp/Gelato-automations.git
synced 2024-07-29 22:28:07 +00:00
fix: adjusted gas constants debt bridge
This commit is contained in:
parent
5e81d8ce75
commit
b3600300fa
|
@ -95,7 +95,7 @@ contract MockDebtBridgeETHBExecutor {
|
|||
// console.log("Gas Cost execViaRoute3: %s", gasLeft - gasleft());
|
||||
}
|
||||
|
||||
function execViaRoute3AndOpenVAult(TaskReceipt memory _taskReceipt) public {
|
||||
function execViaRoute3AndOpenVault(TaskReceipt memory _taskReceipt) public {
|
||||
// uint256 gasLeft = gasleft();
|
||||
IGelatoCore(gelatoCore).exec(_taskReceipt);
|
||||
// console.log(
|
||||
|
|
|
@ -2,8 +2,8 @@
|
|||
pragma solidity 0.7.4;
|
||||
|
||||
function GAS_COSTS_FOR_FULL_REFINANCE() pure returns (uint256[4] memory) {
|
||||
return [uint256(2519000), 3140500, 3971000, 4345000];
|
||||
return [uint256(2000000), 2400000, 2850000, 3500000];
|
||||
}
|
||||
|
||||
uint256 constant PREMIUM = 20;
|
||||
uint256 constant VAULT_CREATION_COST = 100000;
|
||||
uint256 constant VAULT_CREATION_COST = 150000;
|
||||
|
|
|
@ -63,8 +63,7 @@ contract ConditionDestVaultWillBeSafe is GelatoConditionsStandard {
|
|||
uint256 _destVaultId,
|
||||
string memory _destColType
|
||||
) public view returns (string memory) {
|
||||
uint256 _destVaultId =
|
||||
_isVaultOwner(_destVaultId, _dsa) ? _destVaultId : 0;
|
||||
_destVaultId = _isVaultOwner(_destVaultId, _dsa) ? _destVaultId : 0;
|
||||
uint256 wDaiToBorrow =
|
||||
_getRealisedDebt(_getMakerVaultDebt(_fromVaultId));
|
||||
uint256 wColToDeposit =
|
||||
|
|
|
@ -80,7 +80,7 @@ module.exports = async function (
|
|||
await expect(
|
||||
contracts.mockDebtBridgeETHBExecutor
|
||||
.connect(wallets.executor)
|
||||
.execViaRoute3AndOpenVAult(taskReceipt, {
|
||||
.execViaRoute3AndOpenVault(taskReceipt, {
|
||||
gasPrice: gelatoGasPrice, // Exectutor must use gelatoGasPrice (Chainlink fast gwei)
|
||||
gasLimit: constants.GAS_LIMIT,
|
||||
})
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
module.exports = {
|
||||
PREMIUM: 20,
|
||||
VAULT_CREATION_COST: 100000,
|
||||
VAULT_CREATION_COST: 150000,
|
||||
};
|
||||
|
|
|
@ -4,16 +4,16 @@ module.exports = (route, withVaultCreation) => {
|
|||
let rawGasCost;
|
||||
switch (route) {
|
||||
case 0:
|
||||
rawGasCost = 2519000; // 2290000 * 1,1 // gas left method measure : 2290000 - 2106637 = 183363 | gas reporter : 2290000 - 1789126 = 500874
|
||||
rawGasCost = 2000000; // 2290000 * 1,1 // gas left method measure : 2290000 - 2106637 = 183363 | gas reporter : 2290000 - 1789126 = 500874
|
||||
break;
|
||||
case 1:
|
||||
rawGasCost = 3140500; // 2855000 * 1,1 // gas left method measure : 2855000 - 2667325 = 187675 | gas reporter : 2855000 - 2244814 = 610186
|
||||
rawGasCost = 2400000; // 2855000 * 1,1 // gas left method measure : 2855000 - 2667325 = 187675 | gas reporter : 2855000 - 2244814 = 610186
|
||||
break;
|
||||
case 2:
|
||||
rawGasCost = 3971000; // 3610000 * 1,1 // gas left method measure : 3610000 - 3423279 = 186721 | gas reporter : 3610000 - 3031103 = 578897
|
||||
rawGasCost = 2850000; // 3610000 * 1,1 // gas left method measure : 3610000 - 3423279 = 186721 | gas reporter : 3610000 - 3031103 = 578897
|
||||
break;
|
||||
case 3:
|
||||
rawGasCost = 4345000; // 3950000 * 1,1 // gas left method measure : 3950000 - 3764004 = 185996 | gas reporter : 3950000 - 3313916 = 636084
|
||||
rawGasCost = 3500000; // 3950000 * 1,1 // gas left method measure : 3950000 - 3764004 = 185996 | gas reporter : 3950000 - 3313916 = 636084
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
|
|
Loading…
Reference in New Issue
Block a user