Smart contracts for DecentraMix.io, a cross-chain, non-custodial privacy-preserving protocol within the DecentraWorld ecosystem.

Overview

➑ DecentraMix.io Solidity Smart Contracts

To get a better understanding of DecentraMix, we recommend to read about the technologies and privacy protocols that DeMix is built upon: Zero-Knowledge Protocol | zkSNARKs | Trusted Setup | and if you really want to dive into the zk protocol, you can create your own zkSNARK circuit. DecentraWorld Website https://decentraworld.co | DecentraMix https://decentramix.io

By default, your entire blockchain transaction history and balances are public. All transactions can be seen on block explorers like BSCScan. Anyone who knows that you own a particular address can quickly view your payments, trace the source of your funds, calculate your holdings, and analyze your on-chain activity. On almost all the most populated blockchains, every transaction, every wallet address, every piece of on-chain data is visible to anyone who wishes to see it. That means that like the blockchain, you as an individual are exposed.But what if you did not want your history and balances to be publicly viewed by everyone? What if you wanted anonymity and privacy when it came to your transactions? What if you don't want every financial step of yours to be mapped, tracked, and sold against your will? This is why DecentraWorld was created, we're simply restoring privacy and financial freedom to humanity. We will not allow governments to invade our, or anyone else's privacy.

DecentraMix (DEMIX), product of DecentraWorld's ecosystem, is a cross-chain, non-custodial, universal privacy-preserving protocol with the decentralized governance. DecentraMix applies zkSNARKs to enable transactional privacy for all DeFi components by breaking the on-chain link between depositor and recipient addresses. On other chains, It uses the smart contracts within this repo, that accepts coins/tokens deposits, which can be withdrawn by a different address. Whenever an asset is withdrawn from DecentraWorld, there is no way to link the withdrawal to the deposit for absolute privacy. On our blockchain, privacy is engraved into each and every transaction by default. We do support compliance across our ecosystem, to keep our platform legal for residents of all countries, we created a compliance page that can prove the origin of the funds sent/received as long as the encrypted note that was given to you at the time of sending/receiving tokens, was saved.

πŸ’± How Does DecentraMix Work?

To explain how DecentraMix **** works we will use Jenny. Jenny decides that she wants to buy something with a token, she then goes on to DecentraMix.io, and deposits that token into the DeMixFactory contract. Jenny will then wait 24+ hours, per our recommendation to ensure privacy & anonymity.

In the meantime, the DeMixFactory.sol contract which accepts your token, will mix your token in between thousands of wallets, all together with other deposits made after yours. Making it impossible to know which token in the contract belongs to who.

Jenny understands how zero-knowledge (zkSNARK) privacy protocols work, she read our documentations. She knows that as long as she stored the encrypted note given to her during the deposit, her funds are safe within the mixing contract, and the only way to withdraw her token is by using her encrypted note. In the meantime, there are more users depositing tokens into DecentraMix, making Jenny's withdrawal more private than ever before.

Once 24 hours have passed, Jenny returns to DecentraMix.io to withdraw her funds into a new wallet. Jenny successfully withdrew her token into a new wallet, without any trace to the original source of the funds, and with full privacy since she followed all of our Anonymity Tips. Now Jenny can trade, shop, transact, etc, but this time, no one can track her financial value, nor her crypto activity.

Be like Jenny! Use DecentraMix.io

Instructions to deploy DecentraMixFactory Contracts

  1. Navigate to demix-core-contracts folder.
  2. Download this folder to your local machine.

Requirements

  1. node v16.14.2(LTS)
  2. yarn @Latest
  3. npm @Latest
  4. 2. npm install -g npx

Initialize

  1. npm install
  2. npm run build

Contracts in order: (migrations)

2 = Hasher.sol
3 = Verifier.sol
4 = DeMixFactory.sol
5 = DeMixToken.sol
6-17 = All Pairs on BSC / Testnet
22-33 = All Pairs on CRO
40-51 = All Pairs on FTM
56-67 = All Pairs on MATIC
72-83 = All Pairs on AVAX
88-99 = All Pairs on ETH
104 = Multicall.sol
105 = DeMixProxyLight.sol
106 = Echoer.sol
(We left 4 slots in between pairs for the DEWO token contracts)
npx truffle migrate --network $network β€”reset --f x --to x x = migrations | $network = network name

Deploy DeMixFactory

  1. cp .env.example .env
  2. Edit .env parameters
  3. npx truffle migrate --network $network --reset --f 2 --to 4 (Deploy Verifier, Hasher, 1st Pool)
  4. Edit .env parameters again for the next pool
  5. npx truffle migrate --network $network --reset --f 4 --to 4
    Note: Repeat the process for as many pool contracts as you need, DeMix uses 4 pools for each native token

Deploy a token (BUSD,USDC,BTCB)

  1. cp .env.example .env
  2. Edit .env parameters
  3. npx truffle migrate --network $network --reset --f 5 β€”to 5
  4. Edit .env parameters again for the next pool
  5. npx truffle migrate --network $network --reset --f 5 β€”to 5
    Note: Repeat the process for as many pool contracts as you wish, DeMix uses 4 pools for each token

Deploy All Contracts For DecentraMix.io (On All Supported Chains)

  1. cp .env.example .env
  2. Edit .env private key parameters, you don't need to change anything else for this method.
  3. BSC: npx truffle migrate --network bsc --reset --f 2 --to 3 && npx truffle migrate --network bsc --reset --f 6 --to 17 && npx truffle migrate --network bsc --reset --f 104 --to 106
  4. Testnet: npx truffle migrate --network testnet --reset --f 2 --to 3 && npx truffle migrate --network testnet --reset --f 6 --to 17 npx truffle migrate --network bsc --reset --f 6 --to 17
  5. CRO: npx truffle migrate --network cronos --reset --f 2 --to 3 && npx truffle migrate --network cronos --reset --f 22 --to 33 npx truffle migrate --network bsc --reset --f 6 --to 17
  6. FTM: npx truffle migrate --network fantom --reset --f 2 --to 3 && npx truffle migrate --network fantom --reset --f 40 β€”to 51 npx truffle migrate --network bsc --reset --f 6 --to 17
  7. MATIC: npx truffle migrate --network matic --reset --f 2 --to 3 && npx truffle migrate --network matic --reset --f 56 β€”to 67 npx truffle migrate --network bsc --reset --f 6 --to 17
  8. AVAX: npx truffle migrate --network avalanche --reset --f 2 --to 3 && npx truffle migrate --network avalanche --reset --f 72 β€”to 83 npx truffle migrate --network bsc --reset --f 6 --to 17
  9. ETH: npx truffle migrate --network mainnet --reset --f 2 --to 3 && npx truffle migrate --network mainnet --reset --f 88 β€”to 99 npx truffle migrate --network bsc --reset --f 6 --to 17

Verify Through Truffle

  1. npm install -D [email protected]
  2. cp secret.json.example secret.json
  3. Update your explorer API keys in secret.json
  4. npx truffle run verify ContractName@0xaddress AnotherContract@0xaddress --network $NetworkName

Verify DeMixFactory & DeMixToken Through Explorer

  1. npm install truffle-flattener -g
  2. npx truffle-flattener ./contracts/DeMixFactory.sol > ./contracts/DeMixFactory_Flat.sol
  3. npx truffle-flattener ./contracts/DeMixToken.sol > ./contracts/DeMixToken_Flat.sol
  4. Go on the relevant explorer (E.g.: cronoscan.com)
  5. Confirm your contract as a single solidity file, and use the ABI code from build, after encoding it with https://abi.hashex.org/.

Deploy Other Contracts (Echoer, ProxyLight, Multicall)

  1. cp .env.example .env
  2. Edit .env parameters
  3. npx truffle migrate --network $NETWORK --reset --f 104 --to 106
You might also like...

πŸŒ³πŸ“ Smart contracts for the Arbor Protocol

Arbor Smart Contracts app testnet landing docs discord blog twitter Security Please report any security issues to [email protected] V1 Smart Contr

Nov 21, 2022

Grupprojekt fΓΆr kurserna 'Javascript med Ramverk' och 'Agil Utveckling'

JavaScript-med-Ramverk-Laboration-3 Grupprojektet fΓΆr kurserna Javascript med Ramverk och Agil Utveckling. Utvecklingsguide FΓΆr information om hur utv

May 18, 2022

Hemsida fΓΆr personer i Sverige som kan och vill erbjuda boende till mΓ€nniskor pΓ₯ flykt

Getting Started with Create React App This project was bootstrapped with Create React App. Available Scripts In the project directory, you can run: np

May 3, 2022

Kurs-repo fΓΆr kursen Webbserver och Databaser

Webbserver och databaser This repository is meant for CME students to access exercises and codealongs that happen throughout the course. I hope you wi

Jan 3, 2023

Lucid is a library, which allows you to create Cardano transactions and off-chain code for your Plutus contracts in JavaScript and Node.js.

Lucid is a library, which allows you to create Cardano transactions and off-chain code for your Plutus contracts in JavaScript and Node.js.

Jan 8, 2023

Async node.js implementation of the UDP Minecraft Server Query Protocol and TCP Minecraft Server List Ping Protocol

πŸ”Ž Mc Server Status Async node.js implementation of the UDP Minecraft Server Query Protocol and TCP Minecraft Server List Ping Protocol. Also availabl

Nov 10, 2022

Perpetual Protocol Curie (v2) core contracts

Perpetual Protocol Curie (v2) core contracts

Dec 15, 2022

binomialpool.finance is an unruggable liquidity pool, running on Binance Smart Chain.

binomialpool.finance is an unruggable liquidity pool, running on Binance Smart Chain.

binomialpool.finance is an unruggable liquidity pool, running on Binance Smart Chain. Unruggable means that the system remains secure even if the core

Mar 3, 2022

Pull a smart contract from mainnet onto your local chain.

hardhat-copy hardhat-copy helps you import an Ethereum mainnet smart contract onto your local Hardhat node, enabling you to rapidly experiment with pr

Aug 21, 2022

Cross Chain Arbitrage Bot Powered by Paraswap

Cross Chain Arbitrage Bot Steps to run the bot: Copy the .env.sample to .env Add private key and providers for polygon and mainnet in the .env file ya

Dec 7, 2022

simple dashboard for cross-chain greeks

simple dashboard for cross-chain greeks

Oh My Greeks Simple platform for cross-chain Greeks Intro We need a place to see all my on-chain greeks.. aggregated nicely. Hosting Currently hosting

Aug 12, 2022

Clean up user-submitted HTML, preserving whitelisted elements and whitelisted attributes on a per-element basis. Built on htmlparser2 for speed and tolerance

sanitize-html sanitize-html provides a simple HTML sanitizer with a clear API. sanitize-html is tolerant. It is well suited for cleaning up HTML fragm

Dec 26, 2022

Download Notion pages as markdown and image files, preserving hierarchy and enabling workflow properties. Works with Docusaurus.

Download Notion pages as markdown and image files, preserving hierarchy and enabling workflow properties. Works with Docusaurus.

notion-pull notion-pull lets you use Notion as your editor for markdown-based static site generators like Docusaurus. Using Notion instead of raw mark

Jan 7, 2023

A simple implementation example (framework) of Deso Protocol's Smart Services.

This project serves as a simple implementation example (framework) of Deso Protocol's Smart Services. This framework comes with out-of-the-box SSL, MongoDB, dev/stage/prod environments, and modularity.

Sep 22, 2022

A collection of smart contracts for the Stackup platform πŸ€– πŸ“‘

Contracts A collection of smart contracts for the Stackup platform. Dev Blog Deployed Contracts See releases for deployed contracts of previous versio

Nov 29, 2021

Ethereum Smart Contracts for locking your Ether and ERC20 tokens based on time and price conditions

SmartHold - a simple way to lock and hold your ETH or ERC20 in a smart contract This is a BETA software that has not been audited for security. USE AT

May 5, 2022

♦ Crowd funding project using Smart Contracts on the Ethereum. Created with Next.js and Tailwind CSS.

♦ Crowd funding project using Smart Contracts on the Ethereum. Created with Next.js and Tailwind CSS.

Crowdcoin ♦ Crowd funding project using Smart Contracts on the Ethereum. Created with Next.js and Tailwind CSS. Project from "Ethereum and Solidity: T

Dec 14, 2022

Using Ethereum Smart Contracts to verify any user's vaccination via Identification Number or QR Code.

Covid-Vaccine-Verification-Blockchain Using Ethereum Smart Contracts to verify any user's vaccination via Identification Number or QR Code. Requiremen

May 14, 2022

Cooperative databases using smart contracts.

Cooperative databases using smart contracts.

Vitra β–ˆβ–ˆβ•— β–ˆβ–ˆβ•—β–ˆβ–ˆβ•—β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•—β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•— β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•— β–ˆβ–ˆβ•‘ β–ˆβ–ˆβ•‘β–ˆβ–ˆβ•‘β•šβ•β•β–ˆβ–ˆβ•”β•β•β•β–ˆβ–ˆβ•”β•β•β–ˆβ–ˆβ•—β–ˆβ–ˆβ•”β•β•β–ˆβ–ˆβ•— β–ˆβ–ˆβ•‘ β–ˆβ–ˆβ•‘β–ˆβ–ˆβ•‘ β–ˆβ–ˆβ•‘ β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•”β•β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•‘ β•šβ–ˆβ–ˆβ•— β–ˆβ–ˆβ•”β•β–ˆβ–ˆβ•‘ β–ˆβ–ˆβ•‘ β–ˆβ–ˆβ•”β•β•β–ˆβ–ˆβ•—β–ˆβ–ˆ

Dec 30, 2022
Owner
DecentraWorld Ecosystem
DecentraWorld provides privacy solutions using Zero-Knowledge cryptography protocols infused into our ecosystem of DApps. Increasing privacy standards in DeFi.
DecentraWorld Ecosystem
Smart contracts for governance. Contract allows to bond custom/LP UNI-v2 tokens and get voting power

Smart contracts for governance. Contract allows to bond custom/LP UNI-v2 tokens and get voting power

Rinat Fihtengolts 3 Oct 2, 2022
DecentraMix.io is a cross-chain, non-custodial, universal privacy-preserving protocol with the decentralized governance

DecentraMix.io is a cross-chain, non-custodial, universal privacy-preserving protocol with the decentralized governance. DecentraWorld applies zkSNARKs to enable transactional privacy for all DeFi components by breaking the on-chain link between depositor and recipient addresses.

DecentraWorld Ecosystem 65 May 7, 2022
A decentralized protocol for indexing and querying data from DecentraMix's on chain contracts across all supported blockchains.

A decentralized protocol for indexing and querying data from DeMix contracts across all supported blockchains.

DecentraWorld Ecosystem 92 May 3, 2022
Privacy Pass: a privacy-enhancing protocol and browser extension.

Privacy Pass Extension The Privacy Pass protocol is now being standardised by the privacypass IETF working group. All contributions are welcome! See t

Privacy Pass Team 1.1k Jan 7, 2023
Toolkit for development, test and deploy smart-contracts on Waves Enterprise ecosystem.

JS Contract SDK Toolkit for development, test and deploy smart-contracts on Waves Enterprise ecosystem. Quickstart The fastest way to get started with

Waves Enterprise 20 Dec 15, 2022
Dapp example for airdropping ERC-20 tokens using World ID, preserving privacy for the claimers with zero-knowledge proofs.

World ID Example - Mesha Airdrop This repository contains an example decentralized application (dapp) for World ID. With Mesha Airdrop test airdroppin

Worldcoin 14 Dec 16, 2022
Privacy preserving governance mechanism using zero knowledge for proof of merkle inclusion.

Zero Knowledge Private Voting V1 Motivation On-chain governance today is fully transparent at the cost of privacy. This means that every proposal and

Blockchain Capital 18 Dec 16, 2022
Privacy preserving governance mechanism using zero knowledge for proof of merkle inclusion.

Zero Knowledge Private Voting V1 Motivation On-chain governance today is fully transparent at the cost of privacy. This means that every proposal and

Blockchain Capital 11 Jun 7, 2022
⚑️The Fullstack React Framework β€” built on Next.js

The Fullstack React Framework "Zero-API" Data Layer β€” Built on Next.js β€” Inspired by Ruby on Rails Read the Documentation β€œZero-API” data layer lets y

⚑️Blitz 12.5k Jan 4, 2023
Elrond blockchain CLI helper tools - interaction with APIs, smart contracts and protocol

Buildo Begins ?? Meet Buildo. He is here to help you start creating in the Elrond blockchain ecosystem. Here is where everything begins. I'm going on

Elrond's Dev Guild 22 Dec 30, 2022