Saltar al contenido principal

Caller Contract for Secure Execution of On-Chain Transactions in CBC20 Token Ecosystems

CIP-108Category: CBCTag: DRAFT2 min de lectura

Caller Contract, Secure Execution of On-Chain Transactions

Abstract

This CIP introduces the "Caller" contract, a specialized smart contract designed to securely execute transactions on behalf of other contracts within the CBC20 token ecosystem. Its primary function is to facilitate the safe and controlled execution of transactions, particularly in systems where external contract interaction is necessary, such as with the BountiableToken contract.

Motivation

The motivation behind this CIP is to provide a secure and controlled way to execute transactions, especially for contracts that involve complex interactions with various parts of the Core Blockchain network. The caller contract serves as a middleman to ensure that only authorized contracts (like the BountiableToken contract) can initiate specific operations, thereby enhancing security and reliability.

Specification

The "Caller" Contract

Key Features:

  • Secure Transaction Execution: Facilitates the execution of external transactions in a controlled environment.
  • Contract Authentication: Only authorized contracts (specified at deployment) can call their functions.
  • Gas Limit Specification: Allows specifying a gas limit for executing transactions to manage transaction costs effectively.

Technical Details

  • Blockchain Compatibility: Core Blockchain (Ylem Version >0.8.0)
  • Core Functionality:
    • bountyCall(address target, bytes memory data, uint256 energyLimit): Executes a transaction to a target address with specified data and energy limit.
  • Security: Includes checks to ensure that the caller is the authorized contract.

Rationale

The caller contract addresses the need for secure and controlled execution of transactions from other contracts. Limiting the ability to initiate transactions to a specified address significantly reduces the risk of unauthorized or malicious actions, which is particularly crucial in contracts handling financial transactions or bounties.

Backward Compatibility

The Caller contract is designed to be compatible with existing CBC20 tokens and Core Blockchain smart contracts, ensuring seamless integration within the Core Blockchain ecosystem.

Security Considerations

Security audits and reviews are recommended to ensure the Caller contract does not introduce vulnerabilities, especially since it deals with executing transactions. Special attention should be paid to the contract's ability to limit execution solely to authorized addresses.

Conclusion

The Caller contract is a crucial component in systems that require secure and controlled execution of external transactions. Its adoption could enhance the security and functionality of CBC20 tokens and other smart contracts that require external interactions within the Core Blockchain network.

Copyright and related rights waived via CC0.