How to implement logic contract

1. No modifications are needed

a. Functions with access control modifier that can register executors.

b. Functions that can be called by anyone

i. Functions that can be called by anyone with a signature like function permit(address owner, address spender, uint value, uint deadline, uint8 v, bytes32 r, bytes32 s) https://bscscan.com/address/0x0eD7e52944161450477ee417DE9Cd3a859b14fD0#code

ii. Functions that can really be called by anyone (public functions without access control)

2. Modifications needed

a. Functions you want to send transactions on behalf of users

i. Create another function with the same purpose that can be called by executors on behalf of your users. You may have your users create their signatures for you and then send the signatures along with the transactions, or you may only send the addresses of the users. How you implement your logic depends on your team, the main point is to create a function that can be called by the executors that can function like your original function without having the users send transactions by themselves.

External tokens

  1. Adding SDK related functions and access control

  2. Adding your tokens as logic contracts and call your ERC20-721-non-related functions on your tokens (2.a.i)

Diamon router/pairs

  1. External logic contracts -> Diamon router

  2. External logic contracts -> Diamon pair

  3. Users with sdk -> Diamon router (swap)

  4. Users with sdk -> Diamon router (add liquidity)

  5. Users with sdk -> Diamon pairs (swap)

  6. Users with sdk -> Diamon pairs (add liquidity)

Newly created tokens, KAP20 and KAP721 for SDK

Last updated