In order to exercise an option, is pretty simple. You just need to have the options address and PodOption interface. Do not forget to approve first the underlying
After allowing the PodOption to transfer the underlying token on your behalf, then you can perform the exercise. Example below:
// 1) Instantiate the Option token using the optionAddress// You can get a current optionAddress from the deployedContracts // sectionIPodOption option =IPodOption(optionAddress);// 2) Approve option contract to spend yours underlyingTokenIERC20 underlyingToken =IERC20(underlyingTokenAddress);underlyingToken.approve(optionAddress, amountOfUnderlying);// 3) Call the exercise function giving the amount of options// to exercise as an input.option.exercise(amountOfOptions);