Merge branch 'development' of github.com:lens-protocol/core-private into development

This commit is contained in:
donosonaumczuk
2023-10-27 13:31:06 -03:00
10 changed files with 1095 additions and 6 deletions

View File

@@ -2,6 +2,8 @@
"mainnet": {
"chainId": 137,
"network": "polygon",
"LensProfilesGuardianTimelock": 604800,
"LensHandlesGuardianTimelock": 86400,
"LensHubProxy": "0xDb46d1Dc155634FbC732f92E853b10B288AD5a1d",
"LensHubImplementation": "0xBA97fc9137b7cbBBC7fcB70a87DA645d917C902F",
"ModuleGlobals": "0x3Df697FF746a60CBe9ee8D47555c88CB66f03BB9",
@@ -57,6 +59,8 @@
"testnet": {
"chainId": 80001,
"network": "mumbai",
"LensProfilesGuardianTimelock": 300,
"LensHandlesGuardianTimelock": 300,
"LensHubProxy": "0x60Ae865ee4C725cd04353b5AAb364553f56ceF82",
"ModuleGlobals": "0x1353aAdfE5FeD85382826757A95DE908bd21C4f9",
"ProfileCreator": "0x6C1e1bC39b13f9E0Af9424D76De899203F47755F",
@@ -143,6 +147,8 @@
"sandbox": {
"chainId": 80001,
"network": "mumbai",
"LensProfilesGuardianTimelock": 300,
"LensHandlesGuardianTimelock": 300,
"LensHubProxy": "0x7582177F9E536aB0b6c721e11f383C326F2Ad1D5",
"LensHubImplementation": "0x7836c7cb79b7f3d53e92c95bf43798ada212fe4e",
"ModuleGlobals": "0xcbCC5b9611d22d11403373432642Df9Ef7Dd81AD",
@@ -157,6 +163,8 @@
"devnet": {
"chainId": 80001,
"network": "mumbai",
"LensProfilesGuardianTimelock": 300,
"LensHandlesGuardianTimelock": 300,
"LensHubProxy": "0xE444E6C7Fa6d21637E2ee724276Ef0b2E9250B1e",
"LensHubImplementation": "0x82eA94D35C8589357222FE39d22076700a86a576",
"ModuleGlobals": "0x2D61Efe6e7c7F696D5e0A6aac43Bd5035F0302B3",

View File

@@ -26,7 +26,7 @@ library MigrationLib {
// Profiles Handles Migration:
event ProfileMigrated(uint256 profileId);
event ProfileMigrated(uint256 indexed profileId);
/**
* @notice Migrates an array of profiles from V1 to V2. This function can be callable by anyone.

View File

@@ -31,8 +31,8 @@ contract A_DeployLensV2Upgrade is Script, ForkManagement, ArrayHelpers {
bytes32 constant PROXY_IMPLEMENTATION_STORAGE_SLOT =
bytes32(uint256(keccak256('eip1967.proxy.implementation')) - 1);
uint256 constant PROFILE_GUARDIAN_COOLDOWN = 7 days;
uint256 constant HANDLE_GUARDIAN_COOLDOWN = 5 minutes;
uint256 internal PROFILE_GUARDIAN_COOLDOWN;
uint256 internal HANDLE_GUARDIAN_COOLDOWN;
string mnemonic;
@@ -153,6 +153,12 @@ contract A_DeployLensV2Upgrade is Script, ForkManagement, ArrayHelpers {
saveContractAddress('Treasury', treasury);
saveValue('TreasuryFee', vm.toString(treasuryFee));
PROFILE_GUARDIAN_COOLDOWN = json.readUint256(string(abi.encodePacked('.', targetEnv, '.LensProfilesGuardianTimelock')));
console.log('PROFILE_GUARDIAN_COOLDOWN: %s', PROFILE_GUARDIAN_COOLDOWN);
HANDLE_GUARDIAN_COOLDOWN = json.readUint256(string(abi.encodePacked('.', targetEnv, '.LensHandlesGuardianTimelock')));
console.log('HANDLE_GUARDIAN_COOLDOWN: %s', HANDLE_GUARDIAN_COOLDOWN);
migrationAdmin = proxyAdmin;
// TODO: change this to the real migration admin
// json.readAddress(string(abi.encodePacked('.', targetEnv, '.MigrationAdmin')));

View File

@@ -0,0 +1,8 @@
# Read $CALLDATA from calldata.txt
CALLDATA=$(cat calldata.txt)
LENSHUB="0x7582177F9E536aB0b6c721e11f383C326F2Ad1D5"
GOVERNANCE="0x56ebd55b2DD089D91D14Ec131Ad41e8474684822"
GOVOWNER="0x532BbA5445e306cB83cF26Ef89842d4701330A45"
cast send --rpc-url mumbai --unlocked --from $GOVOWNER $GOVERNANCE "executeAsGovernance(address,bytes)" $LENSHUB $CALLDATA

1
script/calldata.txt Normal file

File diff suppressed because one or more lines are too long

View File

@@ -47,8 +47,11 @@ str.write(`LENS_PUBLIC_ACT_PROXY=${addresses['PublicActProxy']}\n`);
str.write(`\n# Profile creation proxy\n`);
str.write(`PROFILE_CREATION_PROXY=${addresses['ProfileCreationProxy']}\n`);
str.write(`\n# ModuleRegistry\n`);
str.write(`GLOBAL_MODULE_REGISTRY=${addresses['ModuleGlobals']}\n`);
str.write(`\n# Legacy ModuleGlobals for V1 (deprecated and removed in v2)\n`);
str.write(`LEGACY_MODULE_GLOBALS=${addresses['ModuleGlobals']}\n`);
str.write(`\n# ModuleRegistry (for V2)\n`);
str.write(`GLOBAL_MODULE_REGISTRY=${addresses['ModuleRegistry']}\n`);
// LEGACY COLLECT MODULES

1001
script/migrationAdmins.csv Normal file

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,53 @@
// Read migrationAdmins.csv
// In the format of:
// index,address
// 0,0x1234...
// 1,0x5678...
// ...
const fs = require('fs');
const file = 'migrationAdmins.csv';
const migrationAdmins = [];
// Read file line by line and save to the array
// Skip the first line
fs.readFileSync(file, 'utf-8')
.split(/\r?\n/)
.slice(1)
.forEach(function (line) {
// If line is empty, skip
if (!line) return;
const [index, address] = line.split(',');
migrationAdmins.push(address);
});
// Function setMigrationAdmins(address[] memory migrationAdmins, bool whitelisted)
// Construct the calldata using migrationAdmins and bool true, using ethers
const ethers = require('ethers');
const abi = [
{
inputs: [
{
internalType: 'address[]',
name: 'migrationAdmins',
type: 'address[]',
},
{
internalType: 'bool',
name: 'whitelisted',
type: 'bool',
},
],
name: 'setMigrationAdmins',
outputs: [],
stateMutability: 'nonpayable',
type: 'function',
},
];
const iface = new ethers.utils.Interface(abi);
const data = iface.encodeFunctionData('setMigrationAdmins', [migrationAdmins, true]);
console.log(data);

View File

@@ -0,0 +1,9 @@
ADMIN_TO_VERIFY=$1
LENSHUB="0x7582177F9E536aB0b6c721e11f383C326F2Ad1D5"
STORAGE_SLOT=29
SLOT=$(cast abi-encode "a(address,uint256)" $ADMIN_TO_VERIFY $STORAGE_SLOT)
KECCAK_HASH=$(cast keccak $SLOT)
cast storage --rpc-url mumbai $LENSHUB $KECCAK_HASH