Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

3# Features/sma 328 clean up #48

Merged
merged 7 commits into from
Nov 10, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 1 addition & 8 deletions contracts/test/helpers/MockChainlinkAggregator.sol
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ contract MockChainlinkOracleAggregator is Ownable, IOracleAggregator {
a price of $100.50 might be represented as 100500000000 in the contract, with 9 decimal places
of precision */
uint8 decimals;
// uint8 tokenDecimals;
bool dataSigned;
address callAddress;
bytes callData;
Expand Down Expand Up @@ -96,20 +95,14 @@ contract MockChainlinkOracleAggregator is Ownable, IOracleAggregator {

// Making explicit revert or make use of stale price feed which reverts
// like done in below function and the test case
/*function _getTokenPrice(
address token
) internal view returns (uint256 tokenPriceUnadjusted) {
bool success = false;
require(success, "ChainlinkOracleAggregator:: query failed");
}*/

function _getTokenPrice(
address token
) internal view returns (uint256 tokenPriceUnadjusted) {
(bool success, bytes memory ret) = tokensInfo[token]
.callAddress
.staticcall(tokensInfo[token].callData);
console.log("price feed reverted here? success = %s ", success);

require(success, "ChainlinkOracleAggregator:: query failed");
if (tokensInfo[token].dataSigned) {
tokenPriceUnadjusted = uint256(abi.decode(ret, (int256)));
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
"lint:sol": "yarn solhint 'contracts/**/*.sol'",
"lint:sol-fix": "yarn prettier 'contracts/**/*.sol' --write && yarn solhint 'contracts/**/*.sol' --fix",
"lint:fix": "yarn lint:ts-fix && yarn lint:sol-fix",
"secret": "echo -e '\u001b[31m⚠️ WARNING: This script is intended for development use only. The generated .secret file is NOT SAFE for production environments.\u001b[0m' && echo 'primary twist rack vendor diagram image used route theme frown either will' > .abc",
"postinstall": "husky install",
"prepack": "pinst --disable && ./scripts/prepack-contracts.sh",
"postpack": "pinst --enable && ./scripts/postpack-contracts.sh",
Expand Down
7 changes: 0 additions & 7 deletions scripts/deploy-arbitrum-goerli.ts
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,6 @@ async function deployChainlinkOracleAggregatorContract(
});
} catch (err) {
console.log("issue with the verification ", oracleAggregatorComputedAddr);
// console.log(err);
return oracleAggregatorComputedAddr;
}
} else {
Expand Down Expand Up @@ -147,7 +146,6 @@ async function deployTokenPaymasterContract(
});
} catch (err) {
console.log("issue with the verification ", tokenPaymasterComputedAddr);
// console.log(err);
return tokenPaymasterComputedAddr;
}
} else {
Expand Down Expand Up @@ -217,7 +215,6 @@ async function deployDerivedPriceFeed(
"issue with the verification ",
derivedPriceFeedBComputedAddr
);
// console.log(err);
return derivedPriceFeedBComputedAddr;
}
} else {
Expand Down Expand Up @@ -468,10 +465,6 @@ async function main() {
console.log(
"==================tokenPaymasterInstance======================="
);

// tx = await tokenPaymasterInstance.transferOwnership(owner)
// receipt = await tx.wait()
// console.log("tokenPaymasterInstance ownership transferred to %s", owner);
}
}

Expand Down
10 changes: 4 additions & 6 deletions scripts/deploy-arbitrum-one-mainnet.ts
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ async function deployChainlinkOracleAggregatorContract(
});
} catch (err) {
console.log("issue with the verification ", oracleAggregatorComputedAddr);
// console.log(err);

return oracleAggregatorComputedAddr;
}
} else {
Expand Down Expand Up @@ -150,7 +150,7 @@ async function deployTokenPaymasterContract(
});
} catch (err) {
console.log("issue with the verification ", tokenPaymasterComputedAddr);
// console.log(err);

return tokenPaymasterComputedAddr;
}
} else {
Expand Down Expand Up @@ -220,7 +220,7 @@ async function deployDerivedPriceFeed(
"issue with the verification ",
derivedPriceFeedBComputedAddr
);
// console.log(err);

return derivedPriceFeedBComputedAddr;
}
} else {
Expand Down Expand Up @@ -476,9 +476,7 @@ async function main() {
"==================tokenPaymasterInstance======================="
);

// tx = await tokenPaymasterInstance.transferOwnership(owner)
// receipt = await tx.wait()
// console.log("tokenPaymasterInstance ownership transferred to %s", owner);

}
}

Expand Down
10 changes: 4 additions & 6 deletions scripts/deploy-avalanche-mainnet.ts
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ async function deployChainlinkOracleAggregatorContract(
});
} catch (err) {
console.log("issue with the verification ", oracleAggregatorComputedAddr);
// console.log(err);

return oracleAggregatorComputedAddr;
}
} else {
Expand Down Expand Up @@ -150,7 +150,7 @@ async function deployTokenPaymasterContract(
});
} catch (err) {
console.log("issue with the verification ", tokenPaymasterComputedAddr);
// console.log(err);

return tokenPaymasterComputedAddr;
}
} else {
Expand Down Expand Up @@ -220,7 +220,7 @@ async function deployDerivedPriceFeed(
"issue with the verification ",
derivedPriceFeedBComputedAddr
);
// console.log(err);

return derivedPriceFeedBComputedAddr;
}
} else {
Expand Down Expand Up @@ -473,9 +473,7 @@ async function main() {
"==================tokenPaymasterInstance======================="
);

// tx = await tokenPaymasterInstance.transferOwnership(owner)
// receipt = await tx.wait()
// console.log("tokenPaymasterInstance ownership transferred to %s", owner);

}
}

Expand Down
10 changes: 4 additions & 6 deletions scripts/deploy-avalanche-testnet.ts
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ async function deployChainlinkOracleAggregatorContract(
});
} catch (err) {
console.log("issue with the verification ", oracleAggregatorComputedAddr);
// console.log(err);

return oracleAggregatorComputedAddr;
}
} else {
Expand Down Expand Up @@ -150,7 +150,7 @@ async function deployTokenPaymasterContract(
});
} catch (err) {
console.log("issue with the verification ", tokenPaymasterComputedAddr);
// console.log(err);

return tokenPaymasterComputedAddr;
}
} else {
Expand Down Expand Up @@ -220,7 +220,7 @@ async function deployDerivedPriceFeed(
"issue with the verification ",
derivedPriceFeedBComputedAddr
);
// console.log(err);

return derivedPriceFeedBComputedAddr;
}
} else {
Expand Down Expand Up @@ -473,9 +473,7 @@ async function main() {
"==================tokenPaymasterInstance======================="
);

// tx = await tokenPaymasterInstance.transferOwnership(owner)
// receipt = await tx.wait()
// console.log("tokenPaymasterInstance ownership transferred to %s", owner);

}
}

Expand Down
10 changes: 4 additions & 6 deletions scripts/deploy-base-goerli.ts
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ async function deployChainlinkOracleAggregatorContract(
});
} catch (err) {
console.log("issue with the verification ", oracleAggregatorComputedAddr);
// console.log(err);

return oracleAggregatorComputedAddr;
}
} else {
Expand Down Expand Up @@ -150,7 +150,7 @@ async function deployTokenPaymasterContract(
});
} catch (err) {
console.log("issue with the verification ", tokenPaymasterComputedAddr);
// console.log(err);

return tokenPaymasterComputedAddr;
}
} else {
Expand Down Expand Up @@ -220,7 +220,7 @@ async function deployDerivedPriceFeed(
"issue with the verification ",
derivedPriceFeedBComputedAddr
);
// console.log(err);

return derivedPriceFeedBComputedAddr;
}
} else {
Expand Down Expand Up @@ -473,9 +473,7 @@ async function main() {
"==================tokenPaymasterInstance======================="
);

// tx = await tokenPaymasterInstance.transferOwnership(owner)
// receipt = await tx.wait()
// console.log("tokenPaymasterInstance ownership transferred to %s", owner);

}
}

Expand Down
10 changes: 4 additions & 6 deletions scripts/deploy-bnb-mainnet.ts
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ async function deployChainlinkOracleAggregatorContract(
});
} catch (err) {
console.log("issue with the verification ", oracleAggregatorComputedAddr);
// console.log(err);

return oracleAggregatorComputedAddr;
}
} else {
Expand Down Expand Up @@ -150,7 +150,7 @@ async function deployTokenPaymasterContract(
});
} catch (err) {
console.log("issue with the verification ", tokenPaymasterComputedAddr);
// console.log(err);

return tokenPaymasterComputedAddr;
}
} else {
Expand Down Expand Up @@ -220,7 +220,7 @@ async function deployDerivedPriceFeed(
"issue with the verification ",
derivedPriceFeedBComputedAddr
);
// console.log(err);

return derivedPriceFeedBComputedAddr;
}
} else {
Expand Down Expand Up @@ -476,9 +476,7 @@ async function main() {
"==================tokenPaymasterInstance======================="
);

// tx = await tokenPaymasterInstance.transferOwnership(owner)
// receipt = await tx.wait()
// console.log("tokenPaymasterInstance ownership transferred to %s", owner);

}
}

Expand Down
10 changes: 4 additions & 6 deletions scripts/deploy-bnb-testnet.ts
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ async function deployChainlinkOracleAggregatorContract(
});
} catch (err) {
console.log("issue with the verification ", oracleAggregatorComputedAddr);
// console.log(err);

return oracleAggregatorComputedAddr;
}
} else {
Expand Down Expand Up @@ -150,7 +150,7 @@ async function deployTokenPaymasterContract(
});
} catch (err) {
console.log("issue with the verification ", tokenPaymasterComputedAddr);
// console.log(err);

return tokenPaymasterComputedAddr;
}
} else {
Expand Down Expand Up @@ -220,7 +220,7 @@ async function deployDerivedPriceFeed(
"issue with the verification ",
derivedPriceFeedBComputedAddr
);
// console.log(err);

return derivedPriceFeedBComputedAddr;
}
} else {
Expand Down Expand Up @@ -473,9 +473,7 @@ async function main() {
"==================tokenPaymasterInstance======================="
);

// tx = await tokenPaymasterInstance.transferOwnership(owner)
// receipt = await tx.wait()
// console.log("tokenPaymasterInstance ownership transferred to %s", owner);

}
}

Expand Down
10 changes: 4 additions & 6 deletions scripts/deploy-eth-mainnet.ts
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ async function deployChainlinkOracleAggregatorContract(
});
} catch (err) {
console.log("issue with the verification ", oracleAggregatorComputedAddr);
// console.log(err);

return oracleAggregatorComputedAddr;
}
} else {
Expand Down Expand Up @@ -150,7 +150,7 @@ async function deployTokenPaymasterContract(
});
} catch (err) {
console.log("issue with the verification ", tokenPaymasterComputedAddr);
// console.log(err);

return tokenPaymasterComputedAddr;
}
} else {
Expand Down Expand Up @@ -220,7 +220,7 @@ async function deployDerivedPriceFeed(
"issue with the verification ",
derivedPriceFeedBComputedAddr
);
// console.log(err);

return derivedPriceFeedBComputedAddr;
}
} else {
Expand Down Expand Up @@ -470,9 +470,7 @@ async function main() {
"==================tokenPaymasterInstance======================="
);

// tx = await tokenPaymasterInstance.transferOwnership(owner)
// receipt = await tx.wait()
// console.log("tokenPaymasterInstance ownership transferred to %s", owner);

}
}

Expand Down
10 changes: 4 additions & 6 deletions scripts/deploy-goerli.ts
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ async function deployChainlinkOracleAggregatorContract(
});
} catch (err) {
console.log("issue with the verification ", oracleAggregatorComputedAddr);
// console.log(err);

return oracleAggregatorComputedAddr;
}
} else {
Expand Down Expand Up @@ -150,7 +150,7 @@ async function deployTokenPaymasterContract(
});
} catch (err) {
console.log("issue with the verification ", tokenPaymasterComputedAddr);
// console.log(err);

return tokenPaymasterComputedAddr;
}
} else {
Expand Down Expand Up @@ -220,7 +220,7 @@ async function deployDerivedPriceFeed(
"issue with the verification ",
derivedPriceFeedBComputedAddr
);
// console.log(err);

return derivedPriceFeedBComputedAddr;
}
} else {
Expand Down Expand Up @@ -473,9 +473,7 @@ async function main() {
"==================tokenPaymasterInstance======================="
);

// tx = await tokenPaymasterInstance.transferOwnership(owner)
// receipt = await tx.wait()
// console.log("tokenPaymasterInstance ownership transferred to %s", owner);

}
}

Expand Down
Loading
Loading