Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upgrade scripts and project totals fix #35

Merged
merged 1 commit into from
Feb 17, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -34,7 +34,7 @@ contract RetireC3C3TFacet is ReentrancyGuard {
* @param fromMode From Mode for transfering tokens
* @return retirementIndex The latest retirement index for the beneficiary address
*/
function c3_retireExactC3T(
function c3RetireExactC3T(
address carbonToken,
uint256 amount,
address beneficiaryAddress,
@@ -73,7 +73,7 @@ contract RetireC3C3TFacet is ReentrancyGuard {
* @param fromMode From Mode for transfering tokens
* @return retirementIndex The latest retirement index for the beneficiary address
*/
function c3_retireExactC3TWithEntity(
function c3RetireExactC3TWithEntity(
address carbonToken,
uint256 amount,
string memory retiringEntityString,
Original file line number Diff line number Diff line change
@@ -34,7 +34,7 @@ contract RetireToucanTCO2Facet is ReentrancyGuard {
* @param fromMode From Mode for transfering tokens
* @return retirementIndex The latest retirement index for the beneficiary address
*/
function toucan_retireExactTCO2(
function toucanRetireExactTCO2(
address carbonToken,
uint256 amount,
address beneficiaryAddress,
@@ -73,7 +73,7 @@ contract RetireToucanTCO2Facet is ReentrancyGuard {
* @param fromMode From Mode for transfering tokens
* @return retirementIndex The latest retirement index for the beneficiary address
*/
function toucan_retireExactTCO2WithEntity(
function toucanRetireExactTCO2WithEntity(
address carbonToken,
uint256 amount,
string memory retiringEntityString,
19 changes: 19 additions & 0 deletions contracts/infinity/diamond/init/InitProjectTotals.sol
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;

import "../AppStorage.sol";

contract InitProjectTotals {

AppStorage internal s;

function init() external {
// Update the project amounts retired for transactions sent through V2 thus far

s.a[0x20A580444DD4A90Cc8990DA7B480C5E3d605a26f].totalProjectRetired[0xb139C4cC9D20A3618E9a2268D73Eff18C496B991] += uint(1000000000000000);
s.a[0x808b891a69f2cF52f84228DA61f2F4F5b08297DE].totalProjectRetired[0xb139C4cC9D20A3618E9a2268D73Eff18C496B991] += uint(956844938827);
s.a[0x808b891a69f2cF52f84228DA61f2F4F5b08297DE].totalProjectRetired[0xb139C4cC9D20A3618E9a2268D73Eff18C496B991] += uint(956844938829);
s.a[0xDdfF75A29EB4BFEcF65380de9a75ad08C140eA49].totalProjectRetired[0xb139C4cC9D20A3618E9a2268D73Eff18C496B991] += uint(966561401954341706);
s.a[0x6F9F81eb4f54512Be8c91833783ee0074328E062].totalProjectRetired[0xb139C4cC9D20A3618E9a2268D73Eff18C496B991] += uint(1000000000000000);
}
}
8 changes: 8 additions & 0 deletions contracts/infinity/diamond/init/_EmptyInit.sol
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;

contract _EmptyInit {

function init() external {
}
}
1 change: 1 addition & 0 deletions contracts/infinity/libraries/LibRetire.sol
Original file line number Diff line number Diff line change
@@ -275,6 +275,7 @@ library LibRetire {

// Save the details of the retirement
s.a[beneficiaryAddress].retirements[currentRetirementIndex].projectTokenAddress = projectToken;
s.a[beneficiaryAddress].totalProjectRetired[projectToken] += amount;
}

/* ========== Account Getters ========== */
19 changes: 19 additions & 0 deletions hardhat.config.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
const { utils } = require("ethers");
const fs = require("fs");
const chalk = require("chalk");
const { daoFeeUpgrade } = require("./scripts/infinity/deploy_dao_fee_split");

require("@nomiclabs/hardhat-etherscan");
require("@tenderly/hardhat-tenderly");
@@ -12,6 +13,7 @@ require("@openzeppelin/hardhat-upgrades");
require("dotenv").config();

require("@nomiclabs/hardhat-etherscan");
require("hardhat-contract-sizer")
require("hardhat-gas-reporter");
require("solidity-coverage");

@@ -31,6 +33,11 @@ task("accounts", "Prints the list of accounts", async (taskArgs, hre) => {
}
});

task("upgrade", async () => {
account = await ethers.getSigner()
await daoFeeUpgrade(true, account)
})

task('diamondABI', 'Generates ABI file for diamond, includes all ABIs of facets and subdirectories', async () => {
var walk = function (dir) {
var results = [];
@@ -183,13 +190,25 @@ module.exports = {
accounts:
process.env.PRIVATE_KEY !== undefined ? [process.env.PRIVATE_KEY] : [],
},
polygon: {
url: process.env.POLYGON_URL || "",
gasPrice: 150e9,
timeout: 100000,
accounts:
process.env.PRIVATE_KEY !== undefined ? [process.env.PRIVATE_KEY] : [],
},
},
gasReporter: {
enabled: process.env.REPORT_GAS !== undefined,
currency: "USD",
},
etherscan: {
apiKey: process.env.ETHERSCAN_API_KEY,
customChains: [],
},
polygonscan: {
apiKey: process.env.ETHERSCAN_API_KEY,
customChains: [],
},
};

Loading