Development and testing environment setup is completed, so we can start adding code to the Smart Contract. The first thing we are going to implement is a payment of a loan principal between two accounts. That action will happen after the loan account is opened by a customer. The hook which is run after an account is opened in Vault is the post_activate hook.
From the requirements we analysed earlier we know that we need to move funds between accounts, but for that we also need to know how much money the customer wants to borrow, in which currency and which account they want the principal to be transferred to. This information will come from Contract Parameters, so as a first step, we should define them in our Smart Contract's code. That will look like this: