Skip to content

Commit

Permalink
Feature/microcredit (#135)
Browse files Browse the repository at this point in the history
Co-authored-by: Eduard Dumea <[email protected]>
  • Loading branch information
dumedco and Eduard Dumea committed Apr 5, 2023
1 parent 3be3fe6 commit 09af200
Show file tree
Hide file tree
Showing 12 changed files with 2,626 additions and 46 deletions.
65 changes: 35 additions & 30 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,33 +28,38 @@ $ yarn test

# Contracts

| Contract | Purpose | Address
|-----------------------------------------------------------------------|------------------------------------------------------------------------------|---------------------------------------------|
| `/airgrab/MerkleDistributor.sol` | Merkle Distributor for the initial token airgrab | 0xd2b20e06C19e7b7E7E385b0F1386Cdde8C6dCd2B |
| `/community/CommunityImplementation.sol` | A UBI community that is funded by Impact Labs which beneficiaries claim from | 0xEc94c60f17F7f262973f032965534D1137f1202c |
| `/community/CommunityMiddleProxy.sol` | CommunityMiddleProxy | 0xe8037e4ceEd80EC6D02f482a5A35E0011245FCDC |
| `/community/CommunityAdminProxy.sol` | Proxy contract that orchestrates creation of new Communities | 0xd61c407c3A00dFD8C355973f7a14c55ebaFDf6F9 |
| `/community/CommunityAdminImplementation.sol` | Implementation for the CommunityAdminProxy | 0xFD63395526ef820C5E2A379a36cD578E419b1a71 |
| `/governance/ImpactProxyAdmin.sol` | Contract that is in charge of all the proxies | 0xFC641CE792c242EACcD545B7bee2028f187f61EC |
| `/governance/PACTDelegator.sol` | Proxy contract that manages creation, execution, cancellation of proposals | 0x8f8BB984e652Cb8D0aa7C9D6712Ec2020EB1BAb4 |
| `/governance/PACTDelegate.sol` | Implementation for the PACTDelegate | 0xAeEd98C1c5C268C3E23672166Ea0Bde908C90624 |
| `/governance/PACTTimelock.sol` | Timelock that marshalls the execution of governance proposals | 0xca3171A5FCda4D840Aa375E907b7A1162aDA9379 |
| `/token/DonationMinerProxy.sol` | Proxy vesting contract for non-airgrab distribution of tokens | 0x1C51657af2ceBA3D5492bA0c5A17E562F7ba6593 |
| `/token/DonationMinerImplementation.sol` | Implementation for DonationMinerImplementation | 0x140a654F9BF6Fe736F6e69Ae81377606c43214dF |
| `/token/ImpactLabsProxy.sol` | Vesting contract for ImpactLabs distribution of tokens | 0x767DA1d208DDA5bc517dcd4ba2A83591D68A5535 |
| `/token/ImpactLabsImplementation.sol` | Implementation for ImpactLabsProxy | 0x194f6811Ac5F2FaC8c02eAfBd70567c8597C1B69 |
| `/token/PACTToken.sol` | The Impact Markets cERC-20 token contract | 0x46c9757C5497c5B1f2eb73aE79b6B67D119B0B58 |
| `/token/TreasuryProxy.sol` | Contract that manages the funds | 0xa302dd52a4a85e6778E6A64A0E5EB0e8C76463d6 |
| `/token/TreasuryImplementation.sol` | Implementation for TreasuryProxy | 0x5095C3DC6d89151f79433D84e596fD75EEFa10BB |
| `/staking/StakingProxy.sol` | Contract that manages the staking | 0x1751e740379FC08b7f0eF6d49183fc0931Bd8179 |
| `/staking/StakingImplementation.sol` | Implementation for StakingProxy | 0x6e6b29711A6544cf928708EE0FAA1021FC0DBbEc |
| `/governor/impactMarketCouncil/ImpactMarketCouncilProxy.sol` | ImpactMarketCouncilProxy | 0xF2CA11DA5c3668DD48774f3Ce8ac09aFDc24aF3E |
| `/governor/impactMarketCouncil/ImpactMarketCouncilImplementation.sol` | Implementation for ImpactMarketCouncilProxy | 0x05483De7fE073DdB6f1Dddd7661d4136Af8Af99a |
| `/ambassadors/AmbassadorsProxy.sol` | AmbassadorsProxy | 0x25f58d8C2522dC7E0C53cF8163C837De2415Ba51 |
| `/ambassadors/AmbassadorsImplementation.sol` | Implementation for AmbassadorsProxy | 0x3d150B0f44DaE282D4E5751DD7B8ABE297CD0d49 |
| `/airdropV2/AirdropV2Proxy.sol` | AirdropV2Proxy | 0x482E748D452e6ECD86D58E597B673C5E653dAbe9 |
| `/airdropV2/AirdropV2Implementation.sol` | Implementation for AirdropV2Proxy | 0x72b957fb8F6F25cA6d0a49b0Eb49771Ee16757E6 |
| `/learnAndEarn/LearnAndEarnProxy.sol` | LearnAndEarnProxy | 0x496F7De1420ad52659e257C7Aa3f79a995274dbc |
| `/learnAndEarn/LearnAndEarnImplementation.sol` | Implementation for LearnAndEarnProxy | 0xF01a6816902eC89D8adb9cbD85f4b995756bcF4A |
| `/deposit/DepositProxy.sol` | DepositProxy | 0xF9163f95DF91ad103659cb7C8936Aceb63c7E410 |
| `/deposit/DepositImplementation.sol` | Implementation for DepositProxy | 0x0A547bdE3FB47Bd59A78B0A285dB07C3Fce8b8B6 |
| Contract | Purpose | Address
|-----------------------------------------------------------------------|------------------------------------------------------------------------------|--------------------------------------------|
| `/airgrab/MerkleDistributor.sol` | Merkle Distributor for the initial token airgrab | 0xd2b20e06C19e7b7E7E385b0F1386Cdde8C6dCd2B |
| `/community/CommunityImplementation.sol` | A UBI community that is funded by Impact Labs which beneficiaries claim from | 0xEc94c60f17F7f262973f032965534D1137f1202c |
| `/community/CommunityMiddleProxy.sol` | CommunityMiddleProxy | 0xe8037e4ceEd80EC6D02f482a5A35E0011245FCDC |
| `/community/CommunityAdminProxy.sol` | Proxy contract that orchestrates creation of new Communities | 0xd61c407c3A00dFD8C355973f7a14c55ebaFDf6F9 |
| `/community/CommunityAdminImplementation.sol` | Implementation for the CommunityAdminProxy | 0xFD63395526ef820C5E2A379a36cD578E419b1a71 |
| `/governance/ImpactProxyAdmin.sol` | Contract that is in charge of all the proxies | 0xFC641CE792c242EACcD545B7bee2028f187f61EC |
| `/governance/PACTDelegator.sol` | Proxy contract that manages creation, execution, cancellation of proposals | 0x8f8BB984e652Cb8D0aa7C9D6712Ec2020EB1BAb4 |
| `/governance/PACTDelegate.sol` | Implementation for the PACTDelegate | 0xAeEd98C1c5C268C3E23672166Ea0Bde908C90624 |
| `/governance/PACTTimelock.sol` | Timelock that marshalls the execution of governance proposals | 0xca3171A5FCda4D840Aa375E907b7A1162aDA9379 |
| `/token/DonationMinerProxy.sol` | Proxy vesting contract for non-airgrab distribution of tokens | 0x1C51657af2ceBA3D5492bA0c5A17E562F7ba6593 |
| `/token/DonationMinerImplementation.sol` | Implementation for DonationMinerImplementation | 0x140a654F9BF6Fe736F6e69Ae81377606c43214dF |
| `/token/ImpactLabsProxy.sol` | Vesting contract for ImpactLabs distribution of tokens | 0x767DA1d208DDA5bc517dcd4ba2A83591D68A5535 |
| `/token/ImpactLabsImplementation.sol` | Implementation for ImpactLabsProxy | 0x194f6811Ac5F2FaC8c02eAfBd70567c8597C1B69 |
| `/token/PACTToken.sol` | The Impact Markets cERC-20 token contract | 0x46c9757C5497c5B1f2eb73aE79b6B67D119B0B58 |
| `/token/TreasuryProxy.sol` | Contract that manages the funds | 0xa302dd52a4a85e6778E6A64A0E5EB0e8C76463d6 |
| `/token/TreasuryImplementation.sol` | Implementation for TreasuryProxy | 0x5095C3DC6d89151f79433D84e596fD75EEFa10BB |
| `/staking/StakingProxy.sol` | Contract that manages the staking | 0x1751e740379FC08b7f0eF6d49183fc0931Bd8179 |
| `/staking/StakingImplementation.sol` | Implementation for StakingProxy | 0x6e6b29711A6544cf928708EE0FAA1021FC0DBbEc |
| `/governor/impactMarketCouncil/ImpactMarketCouncilProxy.sol` | ImpactMarketCouncilProxy | 0xF2CA11DA5c3668DD48774f3Ce8ac09aFDc24aF3E |
| `/governor/impactMarketCouncil/ImpactMarketCouncilImplementation.sol` | Implementation for ImpactMarketCouncilProxy | 0x05483De7fE073DdB6f1Dddd7661d4136Af8Af99a |
| `/ambassadors/AmbassadorsProxy.sol` | AmbassadorsProxy | 0x25f58d8C2522dC7E0C53cF8163C837De2415Ba51 |
| `/ambassadors/AmbassadorsImplementation.sol` | Implementation for AmbassadorsProxy | 0x3d150B0f44DaE282D4E5751DD7B8ABE297CD0d49 |
| `/airdropV2/AirdropV2Proxy.sol` | AirdropV2Proxy | 0x482E748D452e6ECD86D58E597B673C5E653dAbe9 |
| `/airdropV2/AirdropV2Implementation.sol` | Implementation for AirdropV2Proxy | 0x72b957fb8F6F25cA6d0a49b0Eb49771Ee16757E6 |
| `/learnAndEarn/LearnAndEarnProxy.sol` | LearnAndEarnProxy | 0x496F7De1420ad52659e257C7Aa3f79a995274dbc |
| `/learnAndEarn/LearnAndEarnImplementation.sol` | Implementation for LearnAndEarnProxy | 0xF01a6816902eC89D8adb9cbD85f4b995756bcF4A |
| `/deposit/DepositProxy.sol` | DepositProxy | 0xF9163f95DF91ad103659cb7C8936Aceb63c7E410 |
| `/deposit/DepositImplementation.sol` | Implementation for DepositProxy | 0x0A547bdE3FB47Bd59A78B0A285dB07C3Fce8b8B6 |
| `/microcredit/ImpactMultiSigProxyAdmin.sol` | Contract that is admin for some proxies | 0x5e7912f6C052D4D7ec8D6a14330c0c3a538e3f2B |
| `/microcredit/MicrocreditRevenueProxy.sol` | Contract that receive all intrest from the microcredit contract | 0xa75D14c212df85F24ead896747cb1688C1F889D7 |
| `/microcredit/MicrocreditRevenueImplementation.sol` | Implementation for MicrocreditRevenueProxy | 0x8622f364a3513f1544e15102571f1D59FfA1943f |
| `/microcredit/MicrocreditProxy.sol` | Proxy for the microcredit pilot | 0xEa4D67c757a6f50974E7fd7B5b1cc7e7910b80Bb |
| `/microcredit/MicrocreditImplementation.sol` | Implementation for MicrocreditProxy | 0x02355305EF2282735737DEDD7F8BDbB661bAB4A8 |
6 changes: 6 additions & 0 deletions contracts/microcredit/ImpactMultiSigProxyAdmin.sol
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
// SPDX-License-Identifier: Apache-2.0
pragma solidity 0.8.4;

import "@openzeppelin/contracts/proxy/transparent/ProxyAdmin.sol";

contract ImpactMultiSigProxyAdmin is ProxyAdmin {}
21 changes: 21 additions & 0 deletions deploy/prod/laterDeployment/impactMultiSigProxyAdmin.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
import { HardhatRuntimeEnvironment } from "hardhat/types";
import { DeployFunction } from "hardhat-deploy/types";
import { SignerWithAddress } from "@nomiclabs/hardhat-ethers/signers";

const func: DeployFunction = async function (hre: HardhatRuntimeEnvironment) {
// @ts-ignore
const { deployments, ethers } = hre;
const { deploy } = deployments;

const accounts: SignerWithAddress[] = await ethers.getSigners();
const deployer = accounts[0];

await deploy("ImpactMultiSigProxyAdmin", {
from: deployer.address,
args: [],
log: true,
});
};

export default func;
func.tags = ["ImpactMultiSigProxyAdminProd"];
21 changes: 9 additions & 12 deletions deploy/prod/laterDeployment/microcredit.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,15 @@ import { DeployFunction } from "hardhat-deploy/types";
import { SignerWithAddress } from "@nomiclabs/hardhat-ethers/signers";


//alfajores
const councilProxyAdminAddress = "0x109106C3C20be1320a2677AC14D62E4309f39280";
const cUSDAddress = "0x874069fa1eb16d44d622f2e0ca25eea172369bc1";
const ownerAddress = "0xa34737409091eBD0726A3Ab5863Fc7Ee9243Edab";



// // mainnet
// const councilProxyAdminAddress = "";
// const cUSDAddress = "";
// //alfajores
// const impactMultiSigProxyAdminAddress = "0x109106C3C20be1320a2677AC14D62E4309f39280";
// const cUSDAddress = "0x874069fa1eb16d44d622f2e0ca25eea172369bc1";
// const ownerAddress = "0xa34737409091eBD0726A3Ab5863Fc7Ee9243Edab";

// mainnet
const impactMultiSigProxyAdminAddress = "0x5e7912f6C052D4D7ec8D6a14330c0c3a538e3f2B";
const cUSDAddress = "0x765DE816845861e75A25fCA122bb6898B8B1282a";
const ownerAddress = "0xa34737409091eBD0726A3Ab5863Fc7Ee9243Edab";

const func: DeployFunction = async function (hre: HardhatRuntimeEnvironment) {
// @ts-ignore
Expand All @@ -38,7 +35,7 @@ const func: DeployFunction = async function (hre: HardhatRuntimeEnvironment) {
await new Promise((resolve) => setTimeout(resolve, 6000));
const microcreditRevenueProxyResult = await deploy("MicrocreditRevenueProxy", {
from: deployer.address,
args: [microcreditRevenueImplementationResult.address, councilProxyAdminAddress],
args: [microcreditRevenueImplementationResult.address, impactMultiSigProxyAdminAddress],
log: true,
// gasLimit: 13000000,
});
Expand Down Expand Up @@ -71,7 +68,7 @@ const func: DeployFunction = async function (hre: HardhatRuntimeEnvironment) {
await new Promise((resolve) => setTimeout(resolve, 6000));
const microcreditProxyResult = await deploy("MicrocreditProxy", {
from: deployer.address,
args: [microcreditImplementationResult.address, councilProxyAdminAddress],
args: [microcreditImplementationResult.address, impactMultiSigProxyAdminAddress],
log: true,
// gasLimit: 13000000,
});
Expand Down
6 changes: 3 additions & 3 deletions deploy/test/microcredit.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ const func: DeployFunction = async function (hre: HardhatRuntimeEnvironment) {

const ownerAddress = accounts[1].address; //dev

const CouncilProxyAdminResult = await deploy("CouncilProxyAdmin", {
const ImpactMultiSigProxyAdminResult = await deploy("ImpactMultiSigProxyAdmin", {
from: deployer.address,
args: [],
log: true,
Expand All @@ -40,7 +40,7 @@ const func: DeployFunction = async function (hre: HardhatRuntimeEnvironment) {
from: deployer.address,
args: [
microcreditRevenueImplementationResult.address,
CouncilProxyAdminResult.address,
ImpactMultiSigProxyAdminResult.address,
],
log: true,
// gasLimit: 13000000,
Expand Down Expand Up @@ -70,7 +70,7 @@ const func: DeployFunction = async function (hre: HardhatRuntimeEnvironment) {
from: deployer.address,
args: [
microcreditImplementationResult.address,
CouncilProxyAdminResult.address,
ImpactMultiSigProxyAdminResult.address,
],
log: true,
// gasLimit: 13000000,
Expand Down
Loading

0 comments on commit 09af200

Please sign in to comment.