forked from DMDcoin/diamond-contracts-dao
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request DMDcoin#39 from MSalman6/alpha4
Refund accepted proposal fees to the proposer
- Loading branch information
Showing
9 changed files
with
168 additions
and
74 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
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 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,29 @@ | ||
import hre from "hardhat"; | ||
import { ethers, upgrades } from "hardhat"; | ||
import { attachProxyAdminV5, } from "@openzeppelin/hardhat-upgrades/dist/utils"; | ||
|
||
const daoAddress = "0xDA0da0da0Da0Da0Da0DA00DA0da0da0DA0DA0dA0"; | ||
|
||
async function getUpgradeCalldata() { | ||
const proxyAdmin = await attachProxyAdminV5( | ||
hre, | ||
await upgrades.erc1967.getAdminAddress(daoAddress) | ||
); | ||
|
||
console.log("Proxy Admin: ", proxyAdmin.target) | ||
const factory = await ethers.getContractFactory("DiamondDao"); | ||
const newImplementation = await upgrades.deployImplementation(factory); | ||
|
||
console.log("New imp. address: ", newImplementation) | ||
const calldata = proxyAdmin.interface.encodeFunctionData("upgradeAndCall", [ | ||
daoAddress, | ||
newImplementation, | ||
ethers.hexlify(new Uint8Array()), | ||
]); | ||
console.log("Calldata: ", calldata); | ||
} | ||
|
||
getUpgradeCalldata().catch((error) => { | ||
console.error(error); | ||
process.exitCode = 1; | ||
}); |
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 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