The New Age of Making Exim Agreements: Smart Contracts

Elevating Coimex's Blockchain Capabilities: Comprehensive Smart Contract Development

Coimex is dedicated to constructing a sophisticated network of smart contracts, pivotal to the platform's functionality and integration with oracle services. This intricate development ensures robustness and scalability in our blockchain infrastructure.

Commitment to Best Practices and Security Our smart contracts, both current and future, rigorously follow the best practices as outlined by Consensys. To assure the highest standards of security and reliability, we incorporate functionalities from OpenZeppelin, a leader in audited, secure contract development. This adherence to industry benchmarks guarantees that our blockchain framework remains at the forefront of technological and security advancements.

One of the biggest fund looses in smart contracts are when users accidentally sends ethereum or other tokens to smart contract by mistake. To avoid such losses coimex contracts implement a fail-safe mechanism to withdraw tokens or ethereum by an admin user:

receive() payable external {
        emit ETHReceived(msg.sender, msg.value);
    }

    function withdraw(address payable toAddress, uint amount) public onlyRole(DEFAULT_ADMIN_ROLE) {
        toAddress.transfer(amount);
    }

    function withdrawERC20Token(address payable anERC20TokenAddress, address toAddress, uint amount) public onlyRole(DEFAULT_ADMIN_ROLE) {
        ERC20 token = ERC20(anERC20TokenAddress);
        token.transfer(toAddress, amount);
    }

Coimex Token Smart Contract: Tailored for Ethereum's Ecosystem The Coimex Token Smart Contract, adhering to the ERC-20 standard, is intricately designed to ensure compatibility and interoperability within the vast Ethereum ecosystem. Key specifications include:

  • Total Supply: A carefully considered total of 225,000,000 Exim Tokens.

  • Precision: Support for transactions with up to 8 decimal places.

  • Essential Functions: Encompassing critical ERC-20 functions such as Transfer, Approve, TransferFrom, BalanceOf, and Allowance. Additionally, it includes Transfer and Approval events for transaction tracking.

  • Controlled Token Supply: A deliberate absence of a mint function to cap the total supply, coupled with a burn mechanism, aligns with our strategy for controlled token circulation and value stability.

Trade Deals Smart Contract: Facilitating Seamless International Transactions

This contract is the cornerstone of trade relations on our platform, accommodating importers, exporters, and the platform itself as distinct entities. Each role is pivotal in validating a trade deal, ensuring that all parties are in agreement. This contract incorporates:

  • Detailed trade identifiers for both parties.

  • Agreed payment terms in stable cryptocurrencies.

  • Comprehensive fee and commission structures, including Coimex token specifics.

  • An event-driven notification system for real-time updates and adjustments to trade agreements.

Escrow Smart Contract: A Foundation of Trust and Security

Our Escrow Smart Contract is intricately linked to the trade deals, encapsulating functionalities vital for the integrity of transactions. This contract stands out for:

  • Handling both upfront and full payment processes.

  • Introducing a collateral feature using Exim Tokens, providing importers with an additional layer of transactional security.

  • A robust liquidation function in cases of importer insolvency, ensuring the security of all parties involved.

  • Individually managed wallets for each importer, catering to both trade and collateral needs.

For instance when a trade is completed contract releases the payment like below:

IDealContainer.Deal memory deal = IDealContainer(payment.deal_contract_address).getDealDetails(deal_hash);

        bytes32 wallet_ptr = keccak256(abi.encodePacked(deal.buyer));
        Wallet wallet = wallets[wallet_ptr].wallet;
        if(!payment.commission_fee_paid) {
            wallet.withdrawERC20Token(deal.payment_contract_address, address(this), deal.commission_fee);
            emit FeePaid(deal_hash, deal.commission_fee);
            payment.commission_fee_paid = true;
        }
        wallet.withdrawERC20Token(deal.fee_contract_address, payment.seller_address, deal.later_payment);

        emit FullPaymentReleased(deal_hash, deal.later_payment);
        payment.later_payment_made = true;
        payment.is_closed = true;
        payments[deal_hash] = payment

Below schema explains how contract are utilized by oracle services, and also how contracts interact with each other to release or revert payments according to trade being successfull or not:

DAO Contract: Democratizing Business Decisions

The DAO contract is a testament to our commitment to community-driven governance. It allows Exim Token holders to actively participate in Coimex's strategic decision-making. This contract is designed to:

  • Represent voting power proportional to Exim Token holdings.

  • Facilitate a transparent and equitable voting process for all key business decisions.

A Synchronized Ecosystem for Enhanced Trading Experience

The harmonious interaction between these smart contracts and oracle services forms the core of Coimex's blockchain strategy. This integration not only ensures the security and transparency of our platform but also elevates the overall efficiency and user experience in international trade.

Last updated