Instantiate the data member singleton_instance by passing to its constructor the receiver and the code (in this case receiver.value) parameters; these two combined with "testsingletona" provide access to the partition of the RAM cache used by this singleton. In this example you will initialize the singleton_instance data member in the smart contract constructor, see below:

And below is a possible implementation for the two get and set actions defined above. It also demonstrates the usage of a couple of singleton methods. Note that the set action makes use of the singleton's set method, for which parameter is the account to pay for the new value stored. In this case, the same account name that is stored in the primary value is the payer. However, it can be a different account if so required.