/cloak-service

Cloak service is a protocol, designed to be a brige between Ethereum and the Cloak Network.

Primary LanguageSolidityMIT LicenseMIT

Cloak Service

Cloak service is a protocol, designed to be a brige between Ethereum and the Cloak Network.

The core of the Cloak service protocol is to complete the functions of on-chain hosting and synchronization of user contracts in Ethereum. Cloak service supports proxy protocol developed with EIP1967, such as TransparentUpgradeableProxy in Openzeppelin. To learn more about Cloak visit Cloak docs.


🛠 Install

Clone this repository:

git clone https://github.com/OxHainan/cloak-service.git

and make sure the following dependencies have been installed

npm install -g truffle ganache-cli

📜 Usage

Compile contracts

truffle compile

Testing

truffle test

Deploy contracts

truffle migrate

Contract Escrow

From the user contract, the user can join the cloak using the following operations:

contract Demo {
    uint a;
    function set(uint i) public {
        a += i;
    }

    function get() public view returns(uint) {
        return a;
    }
}

If you want to join the cloak network, you can upgrade to proxy bridage.

proxy.upgradeTo(proxyBridge.address);

Initiate an escrow transaction in our service contract.

service.escrow(proxy.address)

Now, the demo contract has completed contract escrow.