Using select and the multiplexer design pattern
select
statement.
The select
statement takes an encrypted boolean as first argument and two encrypted values as second and third arguments.
The result of the select
statement is the second argument if the first argument is true and the third argument otherwise.
Example usage from the confidential token contract: