Files
core/foundry-scripts/DeployUpgrade.s.sol
donosonaumczuk 20f1add442 misc: Import refactor and LensHubStorageLib
Co-authored-by: Victor Naumik <vicnaum@gmail.com>
2023-02-21 22:55:27 +00:00

39 lines
1.4 KiB
Solidity

// SPDX-License-Identifier: UNLICENSED
pragma solidity ^0.8.13;
import 'forge-std/Script.sol';
import 'forge-std/console2.sol';
import 'contracts/core/LensHub.sol';
import 'contracts/core/FollowNFT.sol';
import 'contracts/core/CollectNFT.sol';
/**
* This script will deploy the current repository implementations, using the given environment
* hub proxy address.
*/
contract DeployUpgradeScript is Script {
function run() public {
uint256 deployerKey = vm.envUint('DEPLOYER_KEY');
address deployer = vm.addr(deployerKey);
address hubProxyAddr = vm.envAddress('HUB_PROXY_ADDRESS');
// Start deployments.
vm.startBroadcast(deployerKey);
// Precompute needed addresss.
address followNFTAddr = computeCreateAddress(deployer, 1);
address collectNFTAddr = computeCreateAddress(deployer, 2);
// Deploy implementation contracts.
address hubImpl = address(new LensHub(followNFTAddr, collectNFTAddr));
address followNFT = address(new FollowNFT(hubProxyAddr));
address collectNFT = address(new CollectNFT(hubProxyAddr));
vm.writeFile('addrs', '');
vm.writeLine('addrs', string(abi.encodePacked('hubImpl: ', vm.toString(hubImpl))));
vm.writeLine('addrs', string(abi.encodePacked('followNFT: ', vm.toString(followNFT))));
vm.writeLine('addrs', string(abi.encodePacked('collectNFT: ', vm.toString(collectNFT))));
}
}