0

Has anyone attempt to build smart contracts for reconciliation and approval workflows/process?

E.g., if fields match, update the string variable and evoke another contract to request for approval

Nathan Aw

  • It might be helpful to be more specific because almost all useful contracts fit this description. For example, escrow, games, crowd funding, all use some set of rules to check conditions leading to something that happens. – Rob Hitchens Apr 6 '18 at 18:36
1

I find the following pattern can be used quite easily for interacting with different contracts. Using interfaces allows you to easily specify the function signatures for different contracts so that your contract knows how to talk to other ones.

interface TestInterface {
    function someAction() external returns (bool);
}

contract SomeContract {
    TestInterface public tI = TestInterface(address(0));

    function someFunc(string _someString) public returns (bool) {
        if (keccak256(_someString) == keccak256("hello")) {
            require(tI.someAction());
        }
    }
}

Links:

https://solidity.readthedocs.io/en/v0.4.21/contracts.html#interfaces

https://zupzup.org/smart-contract-interaction/

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.