-
-
Notifications
You must be signed in to change notification settings - Fork 262
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feature(smart-contracts):
Airdrops
(#15550)
* add contract * linting and cleanup * apply suggestions * blocklist feature * cleanup * update contract * add comprehensive tests * linting * more cleanup * more cleanup * more cleanup * more cleanup * refactored contracts * using the campaign name * adding the chainalisys oracle * adding more tests * fixed tests * linting * moved file * updated version * make contract upgradeable * move released contract to UP folder using `yarn hardhat release --contract contracts/tokens/UP/Airdrops.sol --dest-folder UP` from `smart-contracts` folder * add airdrops deployment script --------- Co-authored-by: Julien Genestoux <[email protected]> Co-authored-by: Clément Renaud <[email protected]>
- Loading branch information
1 parent
1d302bd
commit efdb5e7
Showing
10 changed files
with
3,298 additions
and
6 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,46 @@ | ||
const { | ||
getNetwork, | ||
deployUpgradeableContract, | ||
copyAndBuildContractsAtVersion, | ||
} = require('@unlock-protocol/hardhat-helpers') | ||
|
||
// from https://go.chainalysis.com/chainalysis-oracle-docs.html | ||
const chainalysisOracle = '0x3A91A31cB3dC49b4db9Ce721F50a9D076c8D739B' | ||
|
||
async function main() { | ||
// fetch chain info | ||
const base = await getNetwork(8453) | ||
const { address: upAddress } = base.tokens.find( | ||
(token) => token.symbol === 'UP' | ||
) | ||
const { id: chainId } = await getNetwork() | ||
|
||
console.log(`Deploying UP Airdrops to ${chainId}`) | ||
|
||
const [qualifiedPath] = await copyAndBuildContractsAtVersion(__dirname, [ | ||
{ contractName: 'Airdrops', subfolder: 'UP' }, | ||
]) | ||
|
||
console.log(` waiting for tx to be mined for contract verification...`) | ||
const { address: airdropAddress } = await deployUpgradeableContract( | ||
qualifiedPath, | ||
[upAddress, chainalysisOracle], | ||
{ | ||
wait: 5, | ||
} | ||
) | ||
|
||
console.log(`UP Airdrops deployed at ${airdropAddress}`) | ||
} | ||
|
||
// execute as standalone | ||
if (require.main === module) { | ||
main() | ||
.then(() => process.exit(0)) | ||
.catch((error) => { | ||
console.error(error) | ||
process.exit(1) | ||
}) | ||
} | ||
|
||
module.exports = main |
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
Oops, something went wrong.