introducing cryptopus API.

long-read containing full information about our smart contract

Cryptopusco
3 min readDec 26, 2017

abstract

Solidity Ethereum Virtual Machine based smart contract defining trader-investor relationships and traders profile & functions.

short description

In this article we want to introduce our recent product – cryptopus API. A smart contract, which is aimed to grab, check, prove and store trader’s data. Our main goal is to create a smart contract, which would be able to let traders get proof-of-success. We create our smart contract, because of the growing amount of frauds around the cryptocurrency world and especially around exchanges, where data is not secured by anyone. We collect the provided by traders data, check it and put it into immutable state, by pushing it to IPFS database. We develop a full-stack of DApps, which are going to work together, synchronize and provide the very best service for crypto investors to check traders and invest into them safely, by using generated accounts, which are closed to withdraw. Investors are also in charge to choose the period of time for investments, but traders are also free to choose, which offer they want to accept. By doing it the democratic way, we develop the new relationship quality.

proof-of-success

what is proof-of-success? POSS — a new way to prove private success rate, measured in income of a person. Traders are always aimed to earn more and today they also offer their services to other people. Mostly they are looking for “newbies” or unqualified traders, because it is easier to cloud the eyes of those. By developing our API we want to stop it and bring trustful service.

how to use?

After the deployment, cryptopus team will share smart-contract’s address on the web-page cryptopus.co and in Telegram, Medium, Reddit, Facebook. The address will be accessible from any ETH-based platform (e.g. myetherwallet). For now, it will only be accessible by TXs, but we are working on web version, which will provide a better interface between users and contract.

contract oriented programming

As a fresh paradigm in programming, COP is a very best way to develop smart-contracts. By separating contracts into independent structures, it is possible to achieve mutability of contracts, since each part could be replaced with another version of it. We develop our storage as a contract, that won’t change at all, but the surroundings, the License, these are the parts we want to have upgradable. While the process of upgrading, while using standard development tools, could take too much time, COP let’s us change contract addresses and keep working.

code examples

Implementation of our storage, which stores data provided by traders and their licenses:

struct brokerLicense {
uint256 lastPayment;
uint8 rating;
bool paid;
}

struct brokerWallet {
bytes32 UUID;
address owner;
string APIKey;
string APISecret;
string historyHash;
string balanceHash;
uint256 lastNonce;
}

struct cryptoBroker {
string username;
address originAddress;
uint256 registerDate;
brokerLicense license;
}

Implementation of functions, which activates the smart contract’s internal processes:

function register(string username) payable external {
require(msg.value >= licensePrice);
require(bs.accountNotRegistered(msg.sender));
bs.pushToBrokersList(username, msg.sender);
Elderly[msg.sender] = false;
}

function addWallet(address _owner, string _key, string _secret, uint256 _nonce) payable external {
bytes32 UUID = sha256(_key, _secret);
if(!bs.getWalletByUUID(UUID)) {
bs.pushToWalletsStorage(UUID, _owner, _key, _secret, _nonce);
}
}

function addAccount(address _owner, string _origin, string _key, string _secret, uint256 _nonce) payable external {
require(msg.sender == owner);
bs.pushToExchangeStorage(_owner, _origin, _key, _secret, _nonce);
}

Upgrading mechanism:

function upgradeLicense(address _newLicenseOrigin) onlyOwner external {
require(_newLicenseOrigin != address(0x0));
require(_newLicenseOrigin != bs.getCurrentLicenseAddress());
_newLicenseOrigin.transfer(this.balance);
bs.updateLicenseVersion(_newLicenseOrigin);
selfdestruct(_newLicenseOrigin);
}

conclusion

This article shows off the internal mechanisms of our smart contract. In the next post we are going to introduce you our web-page, which will help people communicate with smart contract.

sources

--

--

Cryptopusco

IPFS-based, open-source blockchain tech brokerage marketplace where cryptocurrency investors choose inkognito traders based on their result of the job.