
Security News
White House Authorizes Private Companies to Conduct Offensive Cyber Operations
A new federal program will let vetted U.S. cybersecurity firms help investigate and disrupt foreign cybercrime groups under government direction.
eth-co2.js is a JavaScript library to enable offsetting of CO2
emissions via the Ethereum blockchain. It is part of the CO2ken
project. More information is available in our
introductory blog
post. You
can also follow us on Twitter.
N.B. This library is currently pre-alpha, and currently only usable on the Rinkeby network! If you are interested in using it, please let us know.
npm run build
For example, to calculate the cost of offsetting a flight from London to New York:
import "babel-polyfill";
import { ethers } from "ethers";
import { getCO2kenPrice } from "eth-co2";
const dapp = async () => {
let provider = new ethers.providers.Web3Provider(web3.currentProvider);
window.price = await getCO2kenPrice(provider);
let flightEmissions = 500; // approx kg CO2 emissions from LON -> NYC flight
let co2kenPrice = await getCO2kenPrice(web3); // Cost in DAI to offset 1 ton of CO2
let offsetCost = flightEmissions / 1000 * co2kenPrice;
};
dapp().catch(e => { console.error(e) });
import { getCo2kenSupply } from "eth-co2";
let supply = await getCo2kenSupply(provider);
import { getCo2kenPaymentsBalance } from "eth-co2";
let balance = await getCo2kenPaymentsBalance(provider);
import { offsetCarbon } from "eth-co2";
await offsetCarbon(provider, dai);
import { getFootprint } from "eth-co2";
let gasFootprint = await getFootprint(provider); // CO2 emissions per gas
let emissions = gasUsed * gasFootprint;
let offsetCost = emissions * co2kenPrice;
import { estimateEmissions } from "eth-co2";
let emissions = await estimateEmissions(provider, contractName, functionName);
FAQs
Carbon offsetting on Ethereum via web3
The npm package eth-co2 receives a total of 1 weekly downloads. As such, eth-co2 popularity was classified as not popular.
We found that eth-co2 demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
A new federal program will let vetted U.S. cybersecurity firms help investigate and disrupt foreign cybercrime groups under government direction.

Research
/Security News
The campaign amassed more than 75,000 installs by targeting Russian-speaking users seeking access to blocked services.

Company News
Open source maintainers are under more pressure than ever. We're raising our open source program from the Team plan to the Business plan, free.