Compare commits
4 Commits
v7.1.0
...
3112ef0e95
| Author | SHA1 | Date | |
|---|---|---|---|
| 3112ef0e95 | |||
|
|
d63f7ca743
|
||
| f10af14fae | |||
|
|
2692613b9a
|
@@ -13,7 +13,6 @@ interface IContributionBalance {
|
|||||||
|
|
||||||
contract Contributor is Initializable {
|
contract Contributor is Initializable {
|
||||||
address public deployer;
|
address public deployer;
|
||||||
address public profileManager;
|
|
||||||
IContributionBalance public contributionContract;
|
IContributionBalance public contributionContract;
|
||||||
IToken public tokenContract;
|
IToken public tokenContract;
|
||||||
|
|
||||||
@@ -30,6 +29,8 @@ contract Contributor is Initializable {
|
|||||||
mapping (uint32 => Contributor) public contributors;
|
mapping (uint32 => Contributor) public contributors;
|
||||||
uint32 public contributorsCount;
|
uint32 public contributorsCount;
|
||||||
|
|
||||||
|
address public profileManager;
|
||||||
|
|
||||||
event ContributorProfileUpdated(uint32 id, bytes32 oldHashDigest, bytes32 newHashDigest); // what should be logged
|
event ContributorProfileUpdated(uint32 id, bytes32 oldHashDigest, bytes32 newHashDigest); // what should be logged
|
||||||
event ContributorAccountUpdated(uint32 id, address oldAccount, address newAccount);
|
event ContributorAccountUpdated(uint32 id, address oldAccount, address newAccount);
|
||||||
event ContributorAdded(uint32 id, address account);
|
event ContributorAdded(uint32 id, address account);
|
||||||
@@ -49,6 +50,10 @@ contract Contributor is Initializable {
|
|||||||
profileManager = profileManagerAddress;
|
profileManager = profileManagerAddress;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function reinitialize(address profileManagerAddress) public reinitializer(2) {
|
||||||
|
profileManager = profileManagerAddress;
|
||||||
|
}
|
||||||
|
|
||||||
function setContributionContract(address contribution) public onlyCore {
|
function setContributionContract(address contribution) public onlyCore {
|
||||||
require(address(contributionContract) == address(0) || addressIsCore(msg.sender), "Core only");
|
require(address(contributionContract) == address(0) || addressIsCore(msg.sender), "Core only");
|
||||||
contributionContract = IContributionBalance(contribution);
|
contributionContract = IContributionBalance(contribution);
|
||||||
|
|||||||
14
package-lock.json
generated
14
package-lock.json
generated
@@ -20,7 +20,7 @@
|
|||||||
"@nomicfoundation/hardhat-chai-matchers": "^1.0.3",
|
"@nomicfoundation/hardhat-chai-matchers": "^1.0.3",
|
||||||
"@nomiclabs/hardhat-ethers": "^2.0.2",
|
"@nomiclabs/hardhat-ethers": "^2.0.2",
|
||||||
"@nomiclabs/hardhat-waffle": "^2.0.1",
|
"@nomiclabs/hardhat-waffle": "^2.0.1",
|
||||||
"@openzeppelin/contracts-upgradeable": "^4.3.2",
|
"@openzeppelin/contracts-upgradeable": "^4.8.3",
|
||||||
"@openzeppelin/hardhat-upgrades": "^1.10.0",
|
"@openzeppelin/hardhat-upgrades": "^1.10.0",
|
||||||
"async-each-series": "^1.1.0",
|
"async-each-series": "^1.1.0",
|
||||||
"chai": "^4.3.6",
|
"chai": "^4.3.6",
|
||||||
@@ -1225,9 +1225,9 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/@openzeppelin/contracts-upgradeable": {
|
"node_modules/@openzeppelin/contracts-upgradeable": {
|
||||||
"version": "4.5.2",
|
"version": "4.8.3",
|
||||||
"resolved": "https://registry.npmjs.org/@openzeppelin/contracts-upgradeable/-/contracts-upgradeable-4.5.2.tgz",
|
"resolved": "https://registry.npmjs.org/@openzeppelin/contracts-upgradeable/-/contracts-upgradeable-4.8.3.tgz",
|
||||||
"integrity": "sha512-xgWZYaPlrEOQo3cBj97Ufiuv79SPd8Brh4GcFYhPgb6WvAq4ppz8dWKL6h+jLAK01rUqMRp/TS9AdXgAeNvCLA==",
|
"integrity": "sha512-SXDRl7HKpl2WDoJpn7CK/M9U4Z8gNXDHHChAKh0Iz+Wew3wu6CmFYBeie3je8V0GSXZAIYYwUktSrnW/kwVPtg==",
|
||||||
"dev": true
|
"dev": true
|
||||||
},
|
},
|
||||||
"node_modules/@openzeppelin/hardhat-upgrades": {
|
"node_modules/@openzeppelin/hardhat-upgrades": {
|
||||||
@@ -20951,9 +20951,9 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"@openzeppelin/contracts-upgradeable": {
|
"@openzeppelin/contracts-upgradeable": {
|
||||||
"version": "4.5.2",
|
"version": "4.8.3",
|
||||||
"resolved": "https://registry.npmjs.org/@openzeppelin/contracts-upgradeable/-/contracts-upgradeable-4.5.2.tgz",
|
"resolved": "https://registry.npmjs.org/@openzeppelin/contracts-upgradeable/-/contracts-upgradeable-4.8.3.tgz",
|
||||||
"integrity": "sha512-xgWZYaPlrEOQo3cBj97Ufiuv79SPd8Brh4GcFYhPgb6WvAq4ppz8dWKL6h+jLAK01rUqMRp/TS9AdXgAeNvCLA==",
|
"integrity": "sha512-SXDRl7HKpl2WDoJpn7CK/M9U4Z8gNXDHHChAKh0Iz+Wew3wu6CmFYBeie3je8V0GSXZAIYYwUktSrnW/kwVPtg==",
|
||||||
"dev": true
|
"dev": true
|
||||||
},
|
},
|
||||||
"@openzeppelin/hardhat-upgrades": {
|
"@openzeppelin/hardhat-upgrades": {
|
||||||
|
|||||||
@@ -42,7 +42,7 @@
|
|||||||
"@nomicfoundation/hardhat-chai-matchers": "^1.0.3",
|
"@nomicfoundation/hardhat-chai-matchers": "^1.0.3",
|
||||||
"@nomiclabs/hardhat-ethers": "^2.0.2",
|
"@nomiclabs/hardhat-ethers": "^2.0.2",
|
||||||
"@nomiclabs/hardhat-waffle": "^2.0.1",
|
"@nomiclabs/hardhat-waffle": "^2.0.1",
|
||||||
"@openzeppelin/contracts-upgradeable": "^4.3.2",
|
"@openzeppelin/contracts-upgradeable": "^4.8.3",
|
||||||
"@openzeppelin/hardhat-upgrades": "^1.10.0",
|
"@openzeppelin/hardhat-upgrades": "^1.10.0",
|
||||||
"async-each-series": "^1.1.0",
|
"async-each-series": "^1.1.0",
|
||||||
"chai": "^4.3.6",
|
"chai": "^4.3.6",
|
||||||
|
|||||||
@@ -7,7 +7,17 @@ async function main() {
|
|||||||
await kredits.init();
|
await kredits.init();
|
||||||
|
|
||||||
const ContributorV2 = await ethers.getContractFactory("Contributor");
|
const ContributorV2 = await ethers.getContractFactory("Contributor");
|
||||||
const contributor = await upgrades.upgradeProxy(kredits.Contributor.address, ContributorV2);
|
const contributor = await upgrades.upgradeProxy(
|
||||||
|
kredits.Contributor.address,
|
||||||
|
ContributorV2,
|
||||||
|
{
|
||||||
|
call: {
|
||||||
|
fn: "reinitialize",
|
||||||
|
args: [
|
||||||
|
"0xc80d2513277FA04B10403E2D1d7dAa86F931f4d1"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
});
|
||||||
console.log("Contributor upgraded");
|
console.log("Contributor upgraded");
|
||||||
console.log(`Contributor address: ${contributor.address}`);
|
console.log(`Contributor address: ${contributor.address}`);
|
||||||
|
|
||||||
@@ -16,4 +26,4 @@ async function main() {
|
|||||||
console.log("DONE!");
|
console.log("DONE!");
|
||||||
}
|
}
|
||||||
|
|
||||||
main();
|
main()
|
||||||
|
|||||||
Reference in New Issue
Block a user