templates.send_back

 1import smartpy as sp
 2
 3
 4@sp.module
 5def main():
 6    class MyContract(sp.Contract):
 7        @sp.entrypoint
 8        def bounce(self):
 9            sp.send(sp.source, sp.amount)
10
11        @sp.entrypoint
12        def bounce2(self):
13            sp.send(sp.source, sp.tez(1))
14            sp.send(sp.source, sp.amount - sp.tez(1))
15
16
17@sp.add_test()
18def test():
19    scenario = sp.test_scenario("Test", main)
20    scenario.h1("Send Back")
21    scenario += main.MyContract()