How to implement logic contract
Last updated
Was this helpful?
Last updated
Was this helpful?
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)
ii. Functions that can really be called by anyone (public functions without access control)
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.
Adding SDK related functions and access control
Adding your tokens as logic contracts and call your ERC20-721-non-related functions on your tokens (2.a.i)
External logic contracts -> Diamon router
External logic contracts -> Diamon pair
Users with sdk -> Diamon router (swap)
Users with sdk -> Diamon router (add liquidity)
Users with sdk -> Diamon pairs (swap)
Users with sdk -> Diamon pairs (add liquidity)
Newly created tokens, KAP20 and KAP721 for SDK