I'm trying to write a contract which function calls are dependent of majority consensus from whitelisted users. E.g. the owner of the contract can initiate a transfer out of the contract, however, the transfer will only go through if majority consensus between whitelisted users are achieved. How can this be architectured?
You want to achieve something similar to a multisig wallets. You need the majority of the owners to approve a proposal before it is executed.
Someone sends a proposal. The contracts generates a proposal id hashing the proposal parameters. Other owners call approve with the proposal id, a vote counter is incremented and when the majority is reached the proposal can be executed. Now the original proposer is enabled to call the contract to execute the proposal.