-
Notifications
You must be signed in to change notification settings - Fork 30
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
57 additions
and
98 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
pragma solidity ^0.8.7; | ||
|
||
interface IERC20Metadata { | ||
/** | ||
* @dev Returns the amount of tokens owned by `account`. | ||
*/ | ||
function balanceOf(address account) external view returns (uint256); | ||
|
||
/** | ||
* @dev Returns the decimals places of the token. | ||
*/ | ||
function decimals() external view returns (uint8); | ||
} | ||
|
||
contract BatchBalance { | ||
function balanceFor( | ||
address[] memory _tokens, | ||
address _account | ||
) external view returns (uint256[] memory balances, uint256[] memory decimals) { | ||
balances = new uint256[](_tokens.length); | ||
decimals = new uint256[](_tokens.length); | ||
for (uint256 i = 0; i < _tokens.length; i++) { | ||
balances[i] = IERC20Metadata(_tokens[i]).balanceOf(_account); | ||
decimals[i] = IERC20Metadata(_tokens[i]).decimals(); | ||
} | ||
return (balances, decimals); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,22 @@ | ||
const { ethers, upgrades } = require("hardhat"); | ||
const { upgradeProxy } = require("../deploy-utils"); | ||
// const { ethers, upgrades } = require("hardhat"); | ||
// const { upgradeProxy } = require("../deploy-utils"); | ||
|
||
module.exports = async function({getNamedAccounts, deployments, network}) { | ||
const { deployer } = await getNamedAccounts(); | ||
// module.exports = async function({getNamedAccounts, deployments, network}) { | ||
// const { deployer } = await getNamedAccounts(); | ||
|
||
console.log('*'.repeat(100)); | ||
console.log(`\tStart bulk contracts upgrading`); | ||
console.log(`\tfrom DEPLOYER ${deployer}`); | ||
console.log('*'.repeat(100)); | ||
// console.log('*'.repeat(100)); | ||
// console.log(`\tStart bulk contracts upgrading`); | ||
// console.log(`\tfrom DEPLOYER ${deployer}`); | ||
// console.log('*'.repeat(100)); | ||
|
||
const contracts = { | ||
// "0x0000000000000000000000000000000000000000": "ContractName", | ||
} | ||
// const contracts = { | ||
// // "0x0000000000000000000000000000000000000000": "ContractName", | ||
// } | ||
|
||
for (const [address, contract] of Object.entries(contracts)) { | ||
await upgradeProxy(contract, address, deployer); | ||
} | ||
}; | ||
// for (const [address, contract] of Object.entries(contracts)) { | ||
// await upgradeProxy(contract, address, deployer); | ||
// } | ||
// }; | ||
|
||
module.exports.tags = ["bulk_upgrade"]; | ||
// module.exports.dependencies = []; | ||
// module.exports.tags = ["bulk_upgrade"]; | ||
// // module.exports.dependencies = []; |