ETH Price: $2,265.24 (-5.90%)

Transaction Decoder

Block:
19432058 at Mar-14-2024 08:27:35 AM +UTC
Transaction Fee:
0.02257886631208587 ETH $51.15
Gas Used:
425,058 Gas / 53.119495015 Gwei

Emitted Events:

53 IlluviumERC20.Transferred( _by=Proxy, _from=Proxy, _to=0xCB782672E1AC9F7C9f32d911ce494b41278c42AB, _value=161940000000000000000 )
54 IlluviumERC20.Transfer( _from=Proxy, _to=0xCB782672E1AC9F7C9f32d911ce494b41278c42AB, _value=161940000000000000000 )
55 IlluviumERC20.Transferred( _by=Proxy, _from=Proxy, _to=0x83FEf611166Ba2599837dB213DCFd17b748bFeB9, _value=161940000000000000000 )
56 IlluviumERC20.Transfer( _from=Proxy, _to=0x83FEf611166Ba2599837dB213DCFd17b748bFeB9, _value=161940000000000000000 )
57 IlluviumERC20.Transferred( _by=Proxy, _from=Proxy, _to=0x2EfBE49994972C4ECCd8342F98b65c636D55C447, _value=161940000000000000000 )
58 IlluviumERC20.Transfer( _from=Proxy, _to=0x2EfBE49994972C4ECCd8342F98b65c636D55C447, _value=161940000000000000000 )
59 IlluviumERC20.Transferred( _by=Proxy, _from=Proxy, _to=0xd01BBF861DA653a15C865d88383159DB9e81bDf6, _value=161940000000000000000 )
60 IlluviumERC20.Transfer( _from=Proxy, _to=0xd01BBF861DA653a15C865d88383159DB9e81bDf6, _value=161940000000000000000 )
61 IlluviumERC20.Transferred( _by=Proxy, _from=Proxy, _to=0xB44083F0016B9E8EEaB42bD873165432Ee9f2E57, _value=72870000000000000000 )
62 IlluviumERC20.Transfer( _from=Proxy, _to=0xB44083F0016B9E8EEaB42bD873165432Ee9f2E57, _value=72870000000000000000 )
63 IlluviumERC20.Transferred( _by=Proxy, _from=Proxy, _to=0xC4b07bab14df8e5053b3D59e58661D13fd73c7f0, _value=48570000000000000000 )
64 IlluviumERC20.Transfer( _from=Proxy, _to=0xC4b07bab14df8e5053b3D59e58661D13fd73c7f0, _value=48570000000000000000 )
65 IlluviumERC20.Transferred( _by=Proxy, _from=Proxy, _to=0xaFF89df806524b0DB210fbD61F1E9a391557ACf7, _value=48570000000000000000 )
66 IlluviumERC20.Transfer( _from=Proxy, _to=0xaFF89df806524b0DB210fbD61F1E9a391557ACf7, _value=48570000000000000000 )
67 IlluviumERC20.Transferred( _by=Proxy, _from=Proxy, _to=0xBEF858F5c33043bDFFAF155549232147bC2f2A2e, _value=48570000000000000000 )
68 IlluviumERC20.Transfer( _from=Proxy, _to=0xBEF858F5c33043bDFFAF155549232147bC2f2A2e, _value=48570000000000000000 )
69 IlluviumERC20.Transferred( _by=Proxy, _from=Proxy, _to=0xe469D67Ede9aEdbda5359aA272C0aC009D60E31a, _value=48570000000000000000 )
70 IlluviumERC20.Transfer( _from=Proxy, _to=0xe469D67Ede9aEdbda5359aA272C0aC009D60E31a, _value=48570000000000000000 )
71 Proxy.0x442e715f626346e8c54381002da614f62bee8d27386535b2521ec8540898556e( 0x442e715f626346e8c54381002da614f62bee8d27386535b2521ec8540898556e, fb6c264fd3cd4ca25d2890c704c601ad62eeb4a788bd03c9782d2f482cc7daaf, 0000000000000000000000000000000000000000000000000000000000000000 )
72 IlluviumERC20.Transferred( _by=Proxy, _from=Proxy, _to=0xD91E88FF9f725Cca7fD280ec9dc4536dCc484B19, _value=25000000000000000000 )
73 IlluviumERC20.Transfer( _from=Proxy, _to=0xD91E88FF9f725Cca7fD280ec9dc4536dCc484B19, _value=25000000000000000000 )
74 IlluviumERC20.Transferred( _by=Proxy, _from=Proxy, _to=0x76238399e20c63bB80e6548AbC3d6b9703c3597b, _value=25000000000000000000 )
75 IlluviumERC20.Transfer( _from=Proxy, _to=0x76238399e20c63bB80e6548AbC3d6b9703c3597b, _value=25000000000000000000 )
76 IlluviumERC20.Transferred( _by=Proxy, _from=Proxy, _to=0xE5bA75Cb106f4A4e303cE149DD7B8482b59a0333, _value=25000000000000000000 )
77 IlluviumERC20.Transfer( _from=Proxy, _to=0xE5bA75Cb106f4A4e303cE149DD7B8482b59a0333, _value=25000000000000000000 )
78 IlluviumERC20.Transferred( _by=Proxy, _from=Proxy, _to=0x99A49b142400D4068a0BCc8601870702A7c082DA, _value=100000000000000000000 )
79 IlluviumERC20.Transfer( _from=Proxy, _to=0x99A49b142400D4068a0BCc8601870702A7c082DA, _value=100000000000000000000 )
80 IlluviumERC20.Transferred( _by=Proxy, _from=Proxy, _to=0x22093F4eE0AC38f54C25F9B9AAA8778b8767735d, _value=100000000000000000000 )
81 IlluviumERC20.Transfer( _from=Proxy, _to=0x22093F4eE0AC38f54C25F9B9AAA8778b8767735d, _value=100000000000000000000 )
82 Proxy.0x442e715f626346e8c54381002da614f62bee8d27386535b2521ec8540898556e( 0x442e715f626346e8c54381002da614f62bee8d27386535b2521ec8540898556e, 8296a6502b73177c2105d02404c01b9d8a0f9f1b0edb1b38a654da9d78733b99, 0000000000000000000000000000000000000000000000000000000000000000 )

Account State Difference:

  Address   Before After State Difference Code
0x2b71c2E2...1A71034D0
1.666750119474752112 Eth
Nonce: 726
1.644171253162666242 Eth
Nonce: 727
0.02257886631208587
0x58C37A62...1d0d738aA
(Illuvium: Treasury)
0x767FE9ED...959D7ca0E
(beaverbuild)
5.225665065916408379 Eth5.227217595242238023 Eth0.001552529325829644

Execution Trace

MultiSendCallOnly.multiSend( transactions=0x0058C37A622CDF8ACE54D8B25C58223F61D0D738AA000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000008846A76120200000000000000000000000040A2ACCBD92BCA938B02010E17A5B8929B49130D00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000140000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000074000000000000000000000000000000000000000000000000000000000000005C48D80FF0A0000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000056100767FE9EDC9E0DF98E07454847909B5E959D7CA0E00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000044A9059CBB000000000000000000000000CB782672E1AC9F7C9F32D911CE494B41278C42AB000000000000000000000000000000000000000000000008C75E74014EC2000000767FE9EDC9E0DF98E07454847909B5E959D7CA0E00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000044A9059CBB00000000000000000000000083FEF611166BA2599837DB213DCFD17B748BFEB9000000000000000000000000000000000000000000000008C75E74014EC2000000767FE9EDC9E0DF98E07454847909B5E959D7CA0E00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000044A9059CBB0000000000000000000000002EFBE49994972C4ECCD8342F98B65C636D55C447000000000000000000000000000000000000000000000008C75E74014EC2000000767FE9EDC9E0DF98E07454847909B5E959D7CA0E00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000044A9059CBB000000000000000000000000D01BBF861DA653A15C865D88383159DB9E81BDF6000000000000000000000000000000000000000000000008C75E74014EC2000000767FE9EDC9E0DF98E07454847909B5E959D7CA0E00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000044A9059CBB000000000000000000000000B44083F0016B9E8EEAB42BD873165432EE9F2E57000000000000000000000000000000000000000000000003F3463EEB0EB7000000767FE9EDC9E0DF98E07454847909B5E959D7CA0E00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000044A9059CBB000000000000000000000000C4B07BAB14DF8E5053B3D59E58661D13FD73C7F0000000000000000000000000000000000000000000000002A20B4DAA44B9000000767FE9EDC9E0DF98E07454847909B5E959D7CA0E00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000044A9059CBB000000000000000000000000AFF89DF806524B0DB210FBD61F1E9A391557ACF7000000000000000000000000000000000000000000000002A20B4DAA44B9000000767FE9EDC9E0DF98E07454847909B5E959D7CA0E00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000044A9059CBB000000000000000000000000BEF858F5C33043BDFFAF155549232147BC2F2A2E000000000000000000000000000000000000000000000002A20B4DAA44B9000000767FE9EDC9E0DF98E07454847909B5E959D7CA0E00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000044A9059CBB000000000000000000000000E469D67EDE9AEDBDA5359AA272C0AC009D60E31A000000000000000000000000000000000000000000000002A20B4DAA44B9000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000104A3D2F076C244E96E482D50581E89DC9B1F92C9F864B76209602DA7DBBBA4BB607072942347B9494380CA6ECD019805822CAAEF1ECA5966A60466E1E797E391C21F7AC9E6129A1069425DC6F713627FC3815FC1869C6482D951C58CA2458FF5A9F851AC7871F6C381342DD40215DD326FBA67E77832E9DFCA8A66094B7AC2802D7B20CC3C0CE3A6AE8120367C3ABCA702AEF517D7455183A8787FDB64F75AD253284C0265516FDF98F96309300F4221CDDABC9AFB3D46A9E3A3F3568C2FF9753F54301BF8F771F7DB2D1EF89EF93FF2780BC3373FBD1E3AF30B8B46D453C01FBA2A08961455AD2C447B292E65C0ACD9B8E18E1EF23952AD2861AB2C8FD9DEDE5F24C35F20000000000000000000000000000000000000000000000000000000000058C37A622CDF8ACE54D8B25C58223F61D0D738AA000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000006046A76120200000000000000000000000040A2ACCBD92BCA938B02010E17A5B8929B49130D0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000014000000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004C000000000000000000000000000000000000000000000000000000000000003448D80FF0A000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000002FD00767FE9EDC9E0DF98E07454847909B5E959D7CA0E00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000044A9059CBB000000000000000000000000D91E88FF9F725CCA7FD280EC9DC4536DCC484B190000000000000000000000000000000000000000000000015AF1D78B58C4000000767FE9EDC9E0DF98E07454847909B5E959D7CA0E00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000044A9059CBB00000000000000000000000076238399E20C63BB80E6548ABC3D6B9703C3597B0000000000000000000000000000000000000000000000015AF1D78B58C4000000767FE9EDC9E0DF98E07454847909B5E959D7CA0E00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000044A9059CBB000000000000000000000000E5BA75CB106F4A4E303CE149DD7B8482B59A03330000000000000000000000000000000000000000000000015AF1D78B58C4000000767FE9EDC9E0DF98E07454847909B5E959D7CA0E00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000044A9059CBB00000000000000000000000099A49B142400D4068A0BCC8601870702A7C082DA0000000000000000000000000000000000000000000000056BC75E2D6310000000767FE9EDC9E0DF98E07454847909B5E959D7CA0E00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000044A9059CBB00000000000000000000000022093F4EE0AC38F54C25F9B9AAA8778B8767735D0000000000000000000000000000000000000000000000056BC75E2D631000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001049E04591CA0BC3A7A48A8467BD9CD8E68F6F1A66D91741B28B29B11DAEF01EB1F01EAF43DD16924712F3FCC0C8C06CD2C5E3E75B15DA7FF40B28E24E5BC5AF09E20947B43D25905E058A59C9119E0D697A98F5BE1913C212DA64CF055A36EA54F3C7229A366869137F60F6061482A554EEAE3F16B6E4EC148C3B7A9FB2D5C7F3FCD2024AC13E349BEEDAC7002B10050030CEAE409AEE57AFA7D427FCC5BFFD39AA7BD24CE9CD7C24A5CB1F5A6FBF0CAADF36A33CC2EDFD687E5D4D3D54D39CF0871F21CB282F157B9296A4D94DDA954B99194D0943FE9F584DC72089415B9CFFC60E14840A8DC0658FCC834674AC4349D9307D82FE8208C2A2DB558BDC0D947E93EA8F71F00000000000000000000000000000000000000000000000000000000 )
  • Proxy.6a761202( )
    • GnosisSafe.execTransaction( to=0x40A2aCCbd92BCA938b02010E17A5b8929b49130D, value=0, data=0x8D80FF0A0000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000056100767FE9EDC9E0DF98E07454847909B5E959D7CA0E00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000044A9059CBB000000000000000000000000CB782672E1AC9F7C9F32D911CE494B41278C42AB000000000000000000000000000000000000000000000008C75E74014EC2000000767FE9EDC9E0DF98E07454847909B5E959D7CA0E00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000044A9059CBB00000000000000000000000083FEF611166BA2599837DB213DCFD17B748BFEB9000000000000000000000000000000000000000000000008C75E74014EC2000000767FE9EDC9E0DF98E07454847909B5E959D7CA0E00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000044A9059CBB0000000000000000000000002EFBE49994972C4ECCD8342F98B65C636D55C447000000000000000000000000000000000000000000000008C75E74014EC2000000767FE9EDC9E0DF98E07454847909B5E959D7CA0E00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000044A9059CBB000000000000000000000000D01BBF861DA653A15C865D88383159DB9E81BDF6000000000000000000000000000000000000000000000008C75E74014EC2000000767FE9EDC9E0DF98E07454847909B5E959D7CA0E00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000044A9059CBB000000000000000000000000B44083F0016B9E8EEAB42BD873165432EE9F2E57000000000000000000000000000000000000000000000003F3463EEB0EB7000000767FE9EDC9E0DF98E07454847909B5E959D7CA0E00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000044A9059CBB000000000000000000000000C4B07BAB14DF8E5053B3D59E58661D13FD73C7F0000000000000000000000000000000000000000000000002A20B4DAA44B9000000767FE9EDC9E0DF98E07454847909B5E959D7CA0E00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000044A9059CBB000000000000000000000000AFF89DF806524B0DB210FBD61F1E9A391557ACF7000000000000000000000000000000000000000000000002A20B4DAA44B9000000767FE9EDC9E0DF98E07454847909B5E959D7CA0E00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000044A9059CBB000000000000000000000000BEF858F5C33043BDFFAF155549232147BC2F2A2E000000000000000000000000000000000000000000000002A20B4DAA44B9000000767FE9EDC9E0DF98E07454847909B5E959D7CA0E00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000044A9059CBB000000000000000000000000E469D67EDE9AEDBDA5359AA272C0AC009D60E31A000000000000000000000000000000000000000000000002A20B4DAA44B9000000000000000000000000000000000000000000000000000000000000000000, operation=1, safeTxGas=0, baseGas=0, gasPrice=0, gasToken=0x0000000000000000000000000000000000000000, refundReceiver=0x0000000000000000000000000000000000000000, signatures=0xA3D2F076C244E96E482D50581E89DC9B1F92C9F864B76209602DA7DBBBA4BB607072942347B9494380CA6ECD019805822CAAEF1ECA5966A60466E1E797E391C21F7AC9E6129A1069425DC6F713627FC3815FC1869C6482D951C58CA2458FF5A9F851AC7871F6C381342DD40215DD326FBA67E77832E9DFCA8A66094B7AC2802D7B20CC3C0CE3A6AE8120367C3ABCA702AEF517D7455183A8787FDB64F75AD253284C0265516FDF98F96309300F4221CDDABC9AFB3D46A9E3A3F3568C2FF9753F54301BF8F771F7DB2D1EF89EF93FF2780BC3373FBD1E3AF30B8B46D453C01FBA2A08961455AD2C447B292E65C0ACD9B8E18E1EF23952AD2861AB2C8FD9DEDE5F24C35F20 ) => ( success=True )
      • Null: 0x000...001.ab97eb92( )
      • Null: 0x000...001.ab97eb92( )
      • Null: 0x000...001.fb6c264f( )
      • Null: 0x000...001.ab97eb92( )
      • MultiSendCallOnly.multiSend( transactions=0x00767FE9EDC9E0DF98E07454847909B5E959D7CA0E00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000044A9059CBB000000000000000000000000CB782672E1AC9F7C9F32D911CE494B41278C42AB000000000000000000000000000000000000000000000008C75E74014EC2000000767FE9EDC9E0DF98E07454847909B5E959D7CA0E00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000044A9059CBB00000000000000000000000083FEF611166BA2599837DB213DCFD17B748BFEB9000000000000000000000000000000000000000000000008C75E74014EC2000000767FE9EDC9E0DF98E07454847909B5E959D7CA0E00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000044A9059CBB0000000000000000000000002EFBE49994972C4ECCD8342F98B65C636D55C447000000000000000000000000000000000000000000000008C75E74014EC2000000767FE9EDC9E0DF98E07454847909B5E959D7CA0E00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000044A9059CBB000000000000000000000000D01BBF861DA653A15C865D88383159DB9E81BDF6000000000000000000000000000000000000000000000008C75E74014EC2000000767FE9EDC9E0DF98E07454847909B5E959D7CA0E00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000044A9059CBB000000000000000000000000B44083F0016B9E8EEAB42BD873165432EE9F2E57000000000000000000000000000000000000000000000003F3463EEB0EB7000000767FE9EDC9E0DF98E07454847909B5E959D7CA0E00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000044A9059CBB000000000000000000000000C4B07BAB14DF8E5053B3D59E58661D13FD73C7F0000000000000000000000000000000000000000000000002A20B4DAA44B9000000767FE9EDC9E0DF98E07454847909B5E959D7CA0E00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000044A9059CBB000000000000000000000000AFF89DF806524B0DB210FBD61F1E9A391557ACF7000000000000000000000000000000000000000000000002A20B4DAA44B9000000767FE9EDC9E0DF98E07454847909B5E959D7CA0E00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000044A9059CBB000000000000000000000000BEF858F5C33043BDFFAF155549232147BC2F2A2E000000000000000000000000000000000000000000000002A20B4DAA44B9000000767FE9EDC9E0DF98E07454847909B5E959D7CA0E00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000044A9059CBB000000000000000000000000E469D67EDE9AEDBDA5359AA272C0AC009D60E31A000000000000000000000000000000000000000000000002A20B4DAA44B90000 )
        • IlluviumERC20.transfer( _to=0xCB782672E1AC9F7C9f32d911ce494b41278c42AB, _value=161940000000000000000 ) => ( success=True )
        • IlluviumERC20.transfer( _to=0x83FEf611166Ba2599837dB213DCFd17b748bFeB9, _value=161940000000000000000 ) => ( success=True )
        • IlluviumERC20.transfer( _to=0x2EfBE49994972C4ECCd8342F98b65c636D55C447, _value=161940000000000000000 ) => ( success=True )
        • IlluviumERC20.transfer( _to=0xd01BBF861DA653a15C865d88383159DB9e81bDf6, _value=161940000000000000000 ) => ( success=True )
        • IlluviumERC20.transfer( _to=0xB44083F0016B9E8EEaB42bD873165432Ee9f2E57, _value=72870000000000000000 ) => ( success=True )
        • IlluviumERC20.transfer( _to=0xC4b07bab14df8e5053b3D59e58661D13fd73c7f0, _value=48570000000000000000 ) => ( success=True )
        • IlluviumERC20.transfer( _to=0xaFF89df806524b0DB210fbD61F1E9a391557ACf7, _value=48570000000000000000 ) => ( success=True )
        • IlluviumERC20.transfer( _to=0xBEF858F5c33043bDFFAF155549232147bC2f2A2e, _value=48570000000000000000 ) => ( success=True )
        • IlluviumERC20.transfer( _to=0xe469D67Ede9aEdbda5359aA272C0aC009D60E31a, _value=48570000000000000000 ) => ( success=True )
        • Proxy.6a761202( )
          • GnosisSafe.execTransaction( to=0x40A2aCCbd92BCA938b02010E17A5b8929b49130D, value=0, data=0x8D80FF0A000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000002FD00767FE9EDC9E0DF98E07454847909B5E959D7CA0E00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000044A9059CBB000000000000000000000000D91E88FF9F725CCA7FD280EC9DC4536DCC484B190000000000000000000000000000000000000000000000015AF1D78B58C4000000767FE9EDC9E0DF98E07454847909B5E959D7CA0E00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000044A9059CBB00000000000000000000000076238399E20C63BB80E6548ABC3D6B9703C3597B0000000000000000000000000000000000000000000000015AF1D78B58C4000000767FE9EDC9E0DF98E07454847909B5E959D7CA0E00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000044A9059CBB000000000000000000000000E5BA75CB106F4A4E303CE149DD7B8482B59A03330000000000000000000000000000000000000000000000015AF1D78B58C4000000767FE9EDC9E0DF98E07454847909B5E959D7CA0E00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000044A9059CBB00000000000000000000000099A49B142400D4068A0BCC8601870702A7C082DA0000000000000000000000000000000000000000000000056BC75E2D6310000000767FE9EDC9E0DF98E07454847909B5E959D7CA0E00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000044A9059CBB00000000000000000000000022093F4EE0AC38F54C25F9B9AAA8778B8767735D0000000000000000000000000000000000000000000000056BC75E2D63100000000000, operation=1, safeTxGas=0, baseGas=0, gasPrice=0, gasToken=0x0000000000000000000000000000000000000000, refundReceiver=0x0000000000000000000000000000000000000000, signatures=0x9E04591CA0BC3A7A48A8467BD9CD8E68F6F1A66D91741B28B29B11DAEF01EB1F01EAF43DD16924712F3FCC0C8C06CD2C5E3E75B15DA7FF40B28E24E5BC5AF09E20947B43D25905E058A59C9119E0D697A98F5BE1913C212DA64CF055A36EA54F3C7229A366869137F60F6061482A554EEAE3F16B6E4EC148C3B7A9FB2D5C7F3FCD2024AC13E349BEEDAC7002B10050030CEAE409AEE57AFA7D427FCC5BFFD39AA7BD24CE9CD7C24A5CB1F5A6FBF0CAADF36A33CC2EDFD687E5D4D3D54D39CF0871F21CB282F157B9296A4D94DDA954B99194D0943FE9F584DC72089415B9CFFC60E14840A8DC0658FCC834674AC4349D9307D82FE8208C2A2DB558BDC0D947E93EA8F71F ) => ( success=True )
            • Null: 0x000...001.9e791278( )
            • Null: 0x000...001.9e791278( )
            • Null: 0x000...001.8296a650( )
            • Null: 0x000...001.9e791278( )
            • MultiSendCallOnly.multiSend( transactions=0x00767FE9EDC9E0DF98E07454847909B5E959D7CA0E00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000044A9059CBB000000000000000000000000D91E88FF9F725CCA7FD280EC9DC4536DCC484B190000000000000000000000000000000000000000000000015AF1D78B58C4000000767FE9EDC9E0DF98E07454847909B5E959D7CA0E00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000044A9059CBB00000000000000000000000076238399E20C63BB80E6548ABC3D6B9703C3597B0000000000000000000000000000000000000000000000015AF1D78B58C4000000767FE9EDC9E0DF98E07454847909B5E959D7CA0E00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000044A9059CBB000000000000000000000000E5BA75CB106F4A4E303CE149DD7B8482B59A03330000000000000000000000000000000000000000000000015AF1D78B58C4000000767FE9EDC9E0DF98E07454847909B5E959D7CA0E00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000044A9059CBB00000000000000000000000099A49B142400D4068A0BCC8601870702A7C082DA0000000000000000000000000000000000000000000000056BC75E2D6310000000767FE9EDC9E0DF98E07454847909B5E959D7CA0E00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000044A9059CBB00000000000000000000000022093F4EE0AC38F54C25F9B9AAA8778B8767735D0000000000000000000000000000000000000000000000056BC75E2D63100000 )
              • IlluviumERC20.transfer( _to=0xD91E88FF9f725Cca7fD280ec9dc4536dCc484B19, _value=25000000000000000000 ) => ( success=True )
              • IlluviumERC20.transfer( _to=0x76238399e20c63bB80e6548AbC3d6b9703c3597b, _value=25000000000000000000 ) => ( success=True )
              • IlluviumERC20.transfer( _to=0xE5bA75Cb106f4A4e303cE149DD7B8482b59a0333, _value=25000000000000000000 ) => ( success=True )
              • IlluviumERC20.transfer( _to=0x99A49b142400D4068a0BCc8601870702A7c082DA, _value=100000000000000000000 ) => ( success=True )
              • IlluviumERC20.transfer( _to=0x22093F4eE0AC38f54C25F9B9AAA8778b8767735d, _value=100000000000000000000 ) => ( success=True )
                File 1 of 4: MultiSendCallOnly
                // SPDX-License-Identifier: LGPL-3.0-only
                pragma solidity >=0.7.0 <0.9.0;
                /// @title Multi Send Call Only - Allows to batch multiple transactions into one, but only calls
                /// @author Stefan George - <[email protected]>
                /// @author Richard Meissner - <[email protected]>
                /// @notice The guard logic is not required here as this contract doesn't support nested delegate calls
                contract MultiSendCallOnly {
                    /// @dev Sends multiple transactions and reverts all if one fails.
                    /// @param transactions Encoded transactions. Each transaction is encoded as a packed bytes of
                    ///                     operation has to be uint8(0) in this version (=> 1 byte),
                    ///                     to as a address (=> 20 bytes),
                    ///                     value as a uint256 (=> 32 bytes),
                    ///                     data length as a uint256 (=> 32 bytes),
                    ///                     data as bytes.
                    ///                     see abi.encodePacked for more information on packed encoding
                    /// @notice The code is for most part the same as the normal MultiSend (to keep compatibility),
                    ///         but reverts if a transaction tries to use a delegatecall.
                    /// @notice This method is payable as delegatecalls keep the msg.value from the previous call
                    ///         If the calling method (e.g. execTransaction) received ETH this would revert otherwise
                    function multiSend(bytes memory transactions) public payable {
                        // solhint-disable-next-line no-inline-assembly
                        assembly {
                            let length := mload(transactions)
                            let i := 0x20
                            for {
                                // Pre block is not used in "while mode"
                            } lt(i, length) {
                                // Post block is not used in "while mode"
                            } {
                                // First byte of the data is the operation.
                                // We shift by 248 bits (256 - 8 [operation byte]) it right since mload will always load 32 bytes (a word).
                                // This will also zero out unused data.
                                let operation := shr(0xf8, mload(add(transactions, i)))
                                // We offset the load address by 1 byte (operation byte)
                                // We shift it right by 96 bits (256 - 160 [20 address bytes]) to right-align the data and zero out unused data.
                                let to := shr(0x60, mload(add(transactions, add(i, 0x01))))
                                // We offset the load address by 21 byte (operation byte + 20 address bytes)
                                let value := mload(add(transactions, add(i, 0x15)))
                                // We offset the load address by 53 byte (operation byte + 20 address bytes + 32 value bytes)
                                let dataLength := mload(add(transactions, add(i, 0x35)))
                                // We offset the load address by 85 byte (operation byte + 20 address bytes + 32 value bytes + 32 data length bytes)
                                let data := add(transactions, add(i, 0x55))
                                let success := 0
                                switch operation
                                    case 0 {
                                        success := call(gas(), to, value, data, dataLength, 0, 0)
                                    }
                                    // This version does not allow delegatecalls
                                    case 1 {
                                        revert(0, 0)
                                    }
                                if eq(success, 0) {
                                    revert(0, 0)
                                }
                                // Next entry starts at 85 byte + data length
                                i := add(i, add(0x55, dataLength))
                            }
                        }
                    }
                }
                

                File 2 of 4: IlluviumERC20
                // SPDX-License-Identifier: MIT
                pragma solidity 0.8.1;
                /**
                 * @title ERC20 token receiver interface
                 *
                 * @dev Interface for any contract that wants to support safe transfers
                 *      from ERC20 token smart contracts.
                 * @dev Inspired by ERC721 and ERC223 token standards
                 *
                 * @dev See https://github.com/ethereum/EIPs/blob/master/EIPS/eip-721.md
                 * @dev See https://github.com/ethereum/EIPs/issues/223
                 *
                 * @author Basil Gorin
                 */
                interface ERC20Receiver {
                  /**
                   * @notice Handle the receipt of a ERC20 token(s)
                   * @dev The ERC20 smart contract calls this function on the recipient
                   *      after a successful transfer (`safeTransferFrom`).
                   *      This function MAY throw to revert and reject the transfer.
                   *      Return of other than the magic value MUST result in the transaction being reverted.
                   * @notice The contract address is always the message sender.
                   *      A wallet/broker/auction application MUST implement the wallet interface
                   *      if it will accept safe transfers.
                   * @param _operator The address which called `safeTransferFrom` function
                   * @param _from The address which previously owned the token
                   * @param _value amount of tokens which is being transferred
                   * @param _data additional data with no specified format
                   * @return `bytes4(keccak256("onERC20Received(address,address,uint256,bytes)"))` unless throwing
                   */
                  function onERC20Received(address _operator, address _from, uint256 _value, bytes calldata _data) external returns(bytes4);
                }
                // SPDX-License-Identifier: MIT
                pragma solidity 0.8.1;
                import "../utils/AddressUtils.sol";
                import "../utils/AccessControl.sol";
                import "./ERC20Receiver.sol";
                /**
                 * @title Illuvium (ILV) ERC20 token
                 *
                 * @notice Illuvium is a core ERC20 token powering the game.
                 *      It serves as an in-game currency, is tradable on exchanges,
                 *      it powers up the governance protocol (Illuvium DAO) and participates in Yield Farming.
                 *
                 * @dev Token Summary:
                 *      - Symbol: ILV
                 *      - Name: Illuvium
                 *      - Decimals: 18
                 *      - Initial token supply: 7,000,000 ILV
                 *      - Maximum final token supply: 10,000,000 ILV
                 *          - Up to 3,000,000 ILV may get minted in 3 years period via yield farming
                 *      - Mintable: total supply may increase
                 *      - Burnable: total supply may decrease
                 *
                 * @dev Token balances and total supply are effectively 192 bits long, meaning that maximum
                 *      possible total supply smart contract is able to track is 2^192 (close to 10^40 tokens)
                 *
                 * @dev Smart contract doesn't use safe math. All arithmetic operations are overflow/underflow safe.
                 *      Additionally, Solidity 0.8.1 enforces overflow/underflow safety.
                 *
                 * @dev ERC20: reviewed according to https://eips.ethereum.org/EIPS/eip-20
                 *
                 * @dev ERC20: contract has passed OpenZeppelin ERC20 tests,
                 *      see https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/test/token/ERC20/ERC20.behavior.js
                 *      see https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/test/token/ERC20/ERC20.test.js
                 *      see adopted copies of these tests in the `test` folder
                 *
                 * @dev ERC223/ERC777: not supported;
                 *      send tokens via `safeTransferFrom` and implement `ERC20Receiver.onERC20Received` on the receiver instead
                 *
                 * @dev Multiple Withdrawal Attack on ERC20 Tokens (ISBN:978-1-7281-3027-9) - resolved
                 *      Related events and functions are marked with "ISBN:978-1-7281-3027-9" tag:
                 *        - event Transferred(address indexed _by, address indexed _from, address indexed _to, uint256 _value)
                 *        - event Approved(address indexed _owner, address indexed _spender, uint256 _oldValue, uint256 _value)
                 *        - function increaseAllowance(address _spender, uint256 _value) public returns (bool)
                 *        - function decreaseAllowance(address _spender, uint256 _value) public returns (bool)
                 *      See: https://ieeexplore.ieee.org/document/8802438
                 *      See: https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
                 *
                 * @author Basil Gorin
                 */
                contract IlluviumERC20 is AccessControl {
                  /**
                   * @dev Smart contract unique identifier, a random number
                   * @dev Should be regenerated each time smart contact source code is changed
                   *      and changes smart contract itself is to be redeployed
                   * @dev Generated using https://www.random.org/bytes/
                   */
                  uint256 public constant TOKEN_UID = 0x83ecb176af7c4f35a45ff0018282e3a05a1018065da866182df12285866f5a2c;
                  /**
                   * @notice Name of the token: Illuvium
                   *
                   * @notice ERC20 name of the token (long name)
                   *
                   * @dev ERC20 `function name() public view returns (string)`
                   *
                   * @dev Field is declared public: getter name() is created when compiled,
                   *      it returns the name of the token.
                   */
                  string public constant name = "Illuvium";
                  /**
                   * @notice Symbol of the token: ILV
                   *
                   * @notice ERC20 symbol of that token (short name)
                   *
                   * @dev ERC20 `function symbol() public view returns (string)`
                   *
                   * @dev Field is declared public: getter symbol() is created when compiled,
                   *      it returns the symbol of the token
                   */
                  string public constant symbol = "ILV";
                  /**
                   * @notice Decimals of the token: 18
                   *
                   * @dev ERC20 `function decimals() public view returns (uint8)`
                   *
                   * @dev Field is declared public: getter decimals() is created when compiled,
                   *      it returns the number of decimals used to get its user representation.
                   *      For example, if `decimals` equals `6`, a balance of `1,500,000` tokens should
                   *      be displayed to a user as `1,5` (`1,500,000 / 10 ** 6`).
                   *
                   * @dev NOTE: This information is only used for _display_ purposes: it in
                   *      no way affects any of the arithmetic of the contract, including balanceOf() and transfer().
                   */
                  uint8 public constant decimals = 18;
                  /**
                   * @notice Total supply of the token: initially 7,000,000,
                   *      with the potential to grow up to 10,000,000 during yield farming period (3 years)
                   *
                   * @dev ERC20 `function totalSupply() public view returns (uint256)`
                   *
                   * @dev Field is declared public: getter totalSupply() is created when compiled,
                   *      it returns the amount of tokens in existence.
                   */
                  uint256 public totalSupply; // is set to 7 million * 10^18 in the constructor
                  /**
                   * @dev A record of all the token balances
                   * @dev This mapping keeps record of all token owners:
                   *      owner => balance
                   */
                  mapping(address => uint256) public tokenBalances;
                  /**
                   * @notice A record of each account's voting delegate
                   *
                   * @dev Auxiliary data structure used to sum up an account's voting power
                   *
                   * @dev This mapping keeps record of all voting power delegations:
                   *      voting delegator (token owner) => voting delegate
                   */
                  mapping(address => address) public votingDelegates;
                  /**
                   * @notice A voting power record binds voting power of a delegate to a particular
                   *      block when the voting power delegation change happened
                   */
                  struct VotingPowerRecord {
                    /*
                     * @dev block.number when delegation has changed; starting from
                     *      that block voting power value is in effect
                     */
                    uint64 blockNumber;
                    /*
                     * @dev cumulative voting power a delegate has obtained starting
                     *      from the block stored in blockNumber
                     */
                    uint192 votingPower;
                  }
                  /**
                   * @notice A record of each account's voting power
                   *
                   * @dev Primarily data structure to store voting power for each account.
                   *      Voting power sums up from the account's token balance and delegated
                   *      balances.
                   *
                   * @dev Stores current value and entire history of its changes.
                   *      The changes are stored as an array of checkpoints.
                   *      Checkpoint is an auxiliary data structure containing voting
                   *      power (number of votes) and block number when the checkpoint is saved
                   *
                   * @dev Maps voting delegate => voting power record
                   */
                  mapping(address => VotingPowerRecord[]) public votingPowerHistory;
                  /**
                   * @dev A record of nonces for signing/validating signatures in `delegateWithSig`
                   *      for every delegate, increases after successful validation
                   *
                   * @dev Maps delegate address => delegate nonce
                   */
                  mapping(address => uint256) public nonces;
                  /**
                   * @notice A record of all the allowances to spend tokens on behalf
                   * @dev Maps token owner address to an address approved to spend
                   *      some tokens on behalf, maps approved address to that amount
                   * @dev owner => spender => value
                   */
                  mapping(address => mapping(address => uint256)) public transferAllowances;
                  /**
                   * @notice Enables ERC20 transfers of the tokens
                   *      (transfer by the token owner himself)
                   * @dev Feature FEATURE_TRANSFERS must be enabled in order for
                   *      `transfer()` function to succeed
                   */
                  uint32 public constant FEATURE_TRANSFERS = 0x0000_0001;
                  /**
                   * @notice Enables ERC20 transfers on behalf
                   *      (transfer by someone else on behalf of token owner)
                   * @dev Feature FEATURE_TRANSFERS_ON_BEHALF must be enabled in order for
                   *      `transferFrom()` function to succeed
                   * @dev Token owner must call `approve()` first to authorize
                   *      the transfer on behalf
                   */
                  uint32 public constant FEATURE_TRANSFERS_ON_BEHALF = 0x0000_0002;
                  /**
                   * @dev Defines if the default behavior of `transfer` and `transferFrom`
                   *      checks if the receiver smart contract supports ERC20 tokens
                   * @dev When feature FEATURE_UNSAFE_TRANSFERS is enabled the transfers do not
                   *      check if the receiver smart contract supports ERC20 tokens,
                   *      i.e. `transfer` and `transferFrom` behave like `unsafeTransferFrom`
                   * @dev When feature FEATURE_UNSAFE_TRANSFERS is disabled (default) the transfers
                   *      check if the receiver smart contract supports ERC20 tokens,
                   *      i.e. `transfer` and `transferFrom` behave like `safeTransferFrom`
                   */
                  uint32 public constant FEATURE_UNSAFE_TRANSFERS = 0x0000_0004;
                  /**
                   * @notice Enables token owners to burn their own tokens,
                   *      including locked tokens which are burnt first
                   * @dev Feature FEATURE_OWN_BURNS must be enabled in order for
                   *      `burn()` function to succeed when called by token owner
                   */
                  uint32 public constant FEATURE_OWN_BURNS = 0x0000_0008;
                  /**
                   * @notice Enables approved operators to burn tokens on behalf of their owners,
                   *      including locked tokens which are burnt first
                   * @dev Feature FEATURE_OWN_BURNS must be enabled in order for
                   *      `burn()` function to succeed when called by approved operator
                   */
                  uint32 public constant FEATURE_BURNS_ON_BEHALF = 0x0000_0010;
                  /**
                   * @notice Enables delegators to elect delegates
                   * @dev Feature FEATURE_DELEGATIONS must be enabled in order for
                   *      `delegate()` function to succeed
                   */
                  uint32 public constant FEATURE_DELEGATIONS = 0x0000_0020;
                  /**
                   * @notice Enables delegators to elect delegates on behalf
                   *      (via an EIP712 signature)
                   * @dev Feature FEATURE_DELEGATIONS must be enabled in order for
                   *      `delegateWithSig()` function to succeed
                   */
                  uint32 public constant FEATURE_DELEGATIONS_ON_BEHALF = 0x0000_0040;
                  /**
                   * @notice Token creator is responsible for creating (minting)
                   *      tokens to an arbitrary address
                   * @dev Role ROLE_TOKEN_CREATOR allows minting tokens
                   *      (calling `mint` function)
                   */
                  uint32 public constant ROLE_TOKEN_CREATOR = 0x0001_0000;
                  /**
                   * @notice Token destroyer is responsible for destroying (burning)
                   *      tokens owned by an arbitrary address
                   * @dev Role ROLE_TOKEN_DESTROYER allows burning tokens
                   *      (calling `burn` function)
                   */
                  uint32 public constant ROLE_TOKEN_DESTROYER = 0x0002_0000;
                  /**
                   * @notice ERC20 receivers are allowed to receive tokens without ERC20 safety checks,
                   *      which may be useful to simplify tokens transfers into "legacy" smart contracts
                   * @dev When `FEATURE_UNSAFE_TRANSFERS` is not enabled addresses having
                   *      `ROLE_ERC20_RECEIVER` permission are allowed to receive tokens
                   *      via `transfer` and `transferFrom` functions in the same way they
                   *      would via `unsafeTransferFrom` function
                   * @dev When `FEATURE_UNSAFE_TRANSFERS` is enabled `ROLE_ERC20_RECEIVER` permission
                   *      doesn't affect the transfer behaviour since
                   *      `transfer` and `transferFrom` behave like `unsafeTransferFrom` for any receiver
                   * @dev ROLE_ERC20_RECEIVER is a shortening for ROLE_UNSAFE_ERC20_RECEIVER
                   */
                  uint32 public constant ROLE_ERC20_RECEIVER = 0x0004_0000;
                  /**
                   * @notice ERC20 senders are allowed to send tokens without ERC20 safety checks,
                   *      which may be useful to simplify tokens transfers into "legacy" smart contracts
                   * @dev When `FEATURE_UNSAFE_TRANSFERS` is not enabled senders having
                   *      `ROLE_ERC20_SENDER` permission are allowed to send tokens
                   *      via `transfer` and `transferFrom` functions in the same way they
                   *      would via `unsafeTransferFrom` function
                   * @dev When `FEATURE_UNSAFE_TRANSFERS` is enabled `ROLE_ERC20_SENDER` permission
                   *      doesn't affect the transfer behaviour since
                   *      `transfer` and `transferFrom` behave like `unsafeTransferFrom` for any receiver
                   * @dev ROLE_ERC20_SENDER is a shortening for ROLE_UNSAFE_ERC20_SENDER
                   */
                  uint32 public constant ROLE_ERC20_SENDER = 0x0008_0000;
                  /**
                   * @dev Magic value to be returned by ERC20Receiver upon successful reception of token(s)
                   * @dev Equal to `bytes4(keccak256("onERC20Received(address,address,uint256,bytes)"))`,
                   *      which can be also obtained as `ERC20Receiver(address(0)).onERC20Received.selector`
                   */
                  bytes4 private constant ERC20_RECEIVED = 0x4fc35859;
                  /**
                   * @notice EIP-712 contract's domain typeHash, see https://eips.ethereum.org/EIPS/eip-712#rationale-for-typehash
                   */
                  bytes32 public constant DOMAIN_TYPEHASH = keccak256("EIP712Domain(string name,uint256 chainId,address verifyingContract)");
                  /**
                   * @notice EIP-712 delegation struct typeHash, see https://eips.ethereum.org/EIPS/eip-712#rationale-for-typehash
                   */
                  bytes32 public constant DELEGATION_TYPEHASH = keccak256("Delegation(address delegate,uint256 nonce,uint256 expiry)");
                  /**
                   * @dev Fired in transfer(), transferFrom() and some other (non-ERC20) functions
                   *
                   * @dev ERC20 `event Transfer(address indexed _from, address indexed _to, uint256 _value)`
                   *
                   * @param _from an address tokens were consumed from
                   * @param _to an address tokens were sent to
                   * @param _value number of tokens transferred
                   */
                  event Transfer(address indexed _from, address indexed _to, uint256 _value);
                  /**
                   * @dev Fired in approve() and approveAtomic() functions
                   *
                   * @dev ERC20 `event Approval(address indexed _owner, address indexed _spender, uint256 _value)`
                   *
                   * @param _owner an address which granted a permission to transfer
                   *      tokens on its behalf
                   * @param _spender an address which received a permission to transfer
                   *      tokens on behalf of the owner `_owner`
                   * @param _value amount of tokens granted to transfer on behalf
                   */
                  event Approval(address indexed _owner, address indexed _spender, uint256 _value);
                  /**
                   * @dev Fired in mint() function
                   *
                   * @param _by an address which minted some tokens (transaction sender)
                   * @param _to an address the tokens were minted to
                   * @param _value an amount of tokens minted
                   */
                  event Minted(address indexed _by, address indexed _to, uint256 _value);
                  /**
                   * @dev Fired in burn() function
                   *
                   * @param _by an address which burned some tokens (transaction sender)
                   * @param _from an address the tokens were burnt from
                   * @param _value an amount of tokens burnt
                   */
                  event Burnt(address indexed _by, address indexed _from, uint256 _value);
                  /**
                   * @dev Resolution for the Multiple Withdrawal Attack on ERC20 Tokens (ISBN:978-1-7281-3027-9)
                   *
                   * @dev Similar to ERC20 Transfer event, but also logs an address which executed transfer
                   *
                   * @dev Fired in transfer(), transferFrom() and some other (non-ERC20) functions
                   *
                   * @param _by an address which performed the transfer
                   * @param _from an address tokens were consumed from
                   * @param _to an address tokens were sent to
                   * @param _value number of tokens transferred
                   */
                  event Transferred(address indexed _by, address indexed _from, address indexed _to, uint256 _value);
                  /**
                   * @dev Resolution for the Multiple Withdrawal Attack on ERC20 Tokens (ISBN:978-1-7281-3027-9)
                   *
                   * @dev Similar to ERC20 Approve event, but also logs old approval value
                   *
                   * @dev Fired in approve() and approveAtomic() functions
                   *
                   * @param _owner an address which granted a permission to transfer
                   *      tokens on its behalf
                   * @param _spender an address which received a permission to transfer
                   *      tokens on behalf of the owner `_owner`
                   * @param _oldValue previously granted amount of tokens to transfer on behalf
                   * @param _value new granted amount of tokens to transfer on behalf
                   */
                  event Approved(address indexed _owner, address indexed _spender, uint256 _oldValue, uint256 _value);
                  /**
                   * @dev Notifies that a key-value pair in `votingDelegates` mapping has changed,
                   *      i.e. a delegator address has changed its delegate address
                   *
                   * @param _of delegator address, a token owner
                   * @param _from old delegate, an address which delegate right is revoked
                   * @param _to new delegate, an address which received the voting power
                   */
                  event DelegateChanged(address indexed _of, address indexed _from, address indexed _to);
                  /**
                   * @dev Notifies that a key-value pair in `votingPowerHistory` mapping has changed,
                   *      i.e. a delegate's voting power has changed.
                   *
                   * @param _of delegate whose voting power has changed
                   * @param _fromVal previous number of votes delegate had
                   * @param _toVal new number of votes delegate has
                   */
                  event VotingPowerChanged(address indexed _of, uint256 _fromVal, uint256 _toVal);
                  /**
                   * @dev Deploys the token smart contract,
                   *      assigns initial token supply to the address specified
                   *
                   * @param _initialHolder owner of the initial token supply
                   */
                  constructor(address _initialHolder) {
                    // verify initial holder address non-zero (is set)
                    require(_initialHolder != address(0), "_initialHolder not set (zero address)");
                    // mint initial supply
                    mint(_initialHolder, 7_000_000e18);
                  }
                  // ===== Start: ERC20/ERC223/ERC777 functions =====
                  /**
                   * @notice Gets the balance of a particular address
                   *
                   * @dev ERC20 `function balanceOf(address _owner) public view returns (uint256 balance)`
                   *
                   * @param _owner the address to query the the balance for
                   * @return balance an amount of tokens owned by the address specified
                   */
                  function balanceOf(address _owner) public view returns (uint256 balance) {
                    // read the balance and return
                    return tokenBalances[_owner];
                  }
                  /**
                   * @notice Transfers some tokens to an external address or a smart contract
                   *
                   * @dev ERC20 `function transfer(address _to, uint256 _value) public returns (bool success)`
                   *
                   * @dev Called by token owner (an address which has a
                   *      positive token balance tracked by this smart contract)
                   * @dev Throws on any error like
                   *      * insufficient token balance or
                   *      * incorrect `_to` address:
                   *          * zero address or
                   *          * self address or
                   *          * smart contract which doesn't support ERC20
                   *
                   * @param _to an address to transfer tokens to,
                   *      must be either an external address or a smart contract,
                   *      compliant with the ERC20 standard
                   * @param _value amount of tokens to be transferred, must
                   *      be greater than zero
                   * @return success true on success, throws otherwise
                   */
                  function transfer(address _to, uint256 _value) public returns (bool success) {
                    // just delegate call to `transferFrom`,
                    // `FEATURE_TRANSFERS` is verified inside it
                    return transferFrom(msg.sender, _to, _value);
                  }
                  /**
                   * @notice Transfers some tokens on behalf of address `_from' (token owner)
                   *      to some other address `_to`
                   *
                   * @dev ERC20 `function transferFrom(address _from, address _to, uint256 _value) public returns (bool success)`
                   *
                   * @dev Called by token owner on his own or approved address,
                   *      an address approved earlier by token owner to
                   *      transfer some amount of tokens on its behalf
                   * @dev Throws on any error like
                   *      * insufficient token balance or
                   *      * incorrect `_to` address:
                   *          * zero address or
                   *          * same as `_from` address (self transfer)
                   *          * smart contract which doesn't support ERC20
                   *
                   * @param _from token owner which approved caller (transaction sender)
                   *      to transfer `_value` of tokens on its behalf
                   * @param _to an address to transfer tokens to,
                   *      must be either an external address or a smart contract,
                   *      compliant with the ERC20 standard
                   * @param _value amount of tokens to be transferred, must
                   *      be greater than zero
                   * @return success true on success, throws otherwise
                   */
                  function transferFrom(address _from, address _to, uint256 _value) public returns (bool success) {
                    // depending on `FEATURE_UNSAFE_TRANSFERS` we execute either safe (default)
                    // or unsafe transfer
                    // if `FEATURE_UNSAFE_TRANSFERS` is enabled
                    // or receiver has `ROLE_ERC20_RECEIVER` permission
                    // or sender has `ROLE_ERC20_SENDER` permission
                    if(isFeatureEnabled(FEATURE_UNSAFE_TRANSFERS)
                      || isOperatorInRole(_to, ROLE_ERC20_RECEIVER)
                      || isSenderInRole(ROLE_ERC20_SENDER)) {
                      // we execute unsafe transfer - delegate call to `unsafeTransferFrom`,
                      // `FEATURE_TRANSFERS` is verified inside it
                      unsafeTransferFrom(_from, _to, _value);
                    }
                    // otherwise - if `FEATURE_UNSAFE_TRANSFERS` is disabled
                    // and receiver doesn't have `ROLE_ERC20_RECEIVER` permission
                    else {
                      // we execute safe transfer - delegate call to `safeTransferFrom`, passing empty `_data`,
                      // `FEATURE_TRANSFERS` is verified inside it
                      safeTransferFrom(_from, _to, _value, "");
                    }
                    // both `unsafeTransferFrom` and `safeTransferFrom` throw on any error, so
                    // if we're here - it means operation successful,
                    // just return true
                    return true;
                  }
                  /**
                   * @notice Transfers some tokens on behalf of address `_from' (token owner)
                   *      to some other address `_to`
                   *
                   * @dev Inspired by ERC721 safeTransferFrom, this function allows to
                   *      send arbitrary data to the receiver on successful token transfer
                   * @dev Called by token owner on his own or approved address,
                   *      an address approved earlier by token owner to
                   *      transfer some amount of tokens on its behalf
                   * @dev Throws on any error like
                   *      * insufficient token balance or
                   *      * incorrect `_to` address:
                   *          * zero address or
                   *          * same as `_from` address (self transfer)
                   *          * smart contract which doesn't support ERC20Receiver interface
                   * @dev Returns silently on success, throws otherwise
                   *
                   * @param _from token owner which approved caller (transaction sender)
                   *      to transfer `_value` of tokens on its behalf
                   * @param _to an address to transfer tokens to,
                   *      must be either an external address or a smart contract,
                   *      compliant with the ERC20 standard
                   * @param _value amount of tokens to be transferred, must
                   *      be greater than zero
                   * @param _data [optional] additional data with no specified format,
                   *      sent in onERC20Received call to `_to` in case if its a smart contract
                   */
                  function safeTransferFrom(address _from, address _to, uint256 _value, bytes memory _data) public {
                    // first delegate call to `unsafeTransferFrom`
                    // to perform the unsafe token(s) transfer
                    unsafeTransferFrom(_from, _to, _value);
                    // after the successful transfer - check if receiver supports
                    // ERC20Receiver and execute a callback handler `onERC20Received`,
                    // reverting whole transaction on any error:
                    // check if receiver `_to` supports ERC20Receiver interface
                    if(AddressUtils.isContract(_to)) {
                      // if `_to` is a contract - execute onERC20Received
                      bytes4 response = ERC20Receiver(_to).onERC20Received(msg.sender, _from, _value, _data);
                      // expected response is ERC20_RECEIVED
                      require(response == ERC20_RECEIVED, "invalid onERC20Received response");
                    }
                  }
                  /**
                   * @notice Transfers some tokens on behalf of address `_from' (token owner)
                   *      to some other address `_to`
                   *
                   * @dev In contrast to `safeTransferFrom` doesn't check recipient
                   *      smart contract to support ERC20 tokens (ERC20Receiver)
                   * @dev Designed to be used by developers when the receiver is known
                   *      to support ERC20 tokens but doesn't implement ERC20Receiver interface
                   * @dev Called by token owner on his own or approved address,
                   *      an address approved earlier by token owner to
                   *      transfer some amount of tokens on its behalf
                   * @dev Throws on any error like
                   *      * insufficient token balance or
                   *      * incorrect `_to` address:
                   *          * zero address or
                   *          * same as `_from` address (self transfer)
                   * @dev Returns silently on success, throws otherwise
                   *
                   * @param _from token owner which approved caller (transaction sender)
                   *      to transfer `_value` of tokens on its behalf
                   * @param _to an address to transfer tokens to,
                   *      must be either an external address or a smart contract,
                   *      compliant with the ERC20 standard
                   * @param _value amount of tokens to be transferred, must
                   *      be greater than zero
                   */
                  function unsafeTransferFrom(address _from, address _to, uint256 _value) public {
                    // if `_from` is equal to sender, require transfers feature to be enabled
                    // otherwise require transfers on behalf feature to be enabled
                    require(_from == msg.sender && isFeatureEnabled(FEATURE_TRANSFERS)
                         || _from != msg.sender && isFeatureEnabled(FEATURE_TRANSFERS_ON_BEHALF),
                            _from == msg.sender? "transfers are disabled": "transfers on behalf are disabled");
                    // non-zero source address check - Zeppelin
                    // obviously, zero source address is a client mistake
                    // it's not part of ERC20 standard but it's reasonable to fail fast
                    // since for zero value transfer transaction succeeds otherwise
                    require(_from != address(0), "ERC20: transfer from the zero address"); // Zeppelin msg
                    // non-zero recipient address check
                    require(_to != address(0), "ERC20: transfer to the zero address"); // Zeppelin msg
                    // sender and recipient cannot be the same
                    require(_from != _to, "sender and recipient are the same (_from = _to)");
                    // sending tokens to the token smart contract itself is a client mistake
                    require(_to != address(this), "invalid recipient (transfer to the token smart contract itself)");
                    // according to ERC-20 Token Standard, https://eips.ethereum.org/EIPS/eip-20
                    // "Transfers of 0 values MUST be treated as normal transfers and fire the Transfer event."
                    if(_value == 0) {
                      // emit an ERC20 transfer event
                      emit Transfer(_from, _to, _value);
                      // don't forget to return - we're done
                      return;
                    }
                    // no need to make arithmetic overflow check on the _value - by design of mint()
                    // in case of transfer on behalf
                    if(_from != msg.sender) {
                      // read allowance value - the amount of tokens allowed to transfer - into the stack
                      uint256 _allowance = transferAllowances[_from][msg.sender];
                      // verify sender has an allowance to transfer amount of tokens requested
                      require(_allowance >= _value, "ERC20: transfer amount exceeds allowance"); // Zeppelin msg
                      // update allowance value on the stack
                      _allowance -= _value;
                      // update the allowance value in storage
                      transferAllowances[_from][msg.sender] = _allowance;
                      // emit an improved atomic approve event
                      emit Approved(_from, msg.sender, _allowance + _value, _allowance);
                      // emit an ERC20 approval event to reflect the decrease
                      emit Approval(_from, msg.sender, _allowance);
                    }
                    // verify sender has enough tokens to transfer on behalf
                    require(tokenBalances[_from] >= _value, "ERC20: transfer amount exceeds balance"); // Zeppelin msg
                    // perform the transfer:
                    // decrease token owner (sender) balance
                    tokenBalances[_from] -= _value;
                    // increase `_to` address (receiver) balance
                    tokenBalances[_to] += _value;
                    // move voting power associated with the tokens transferred
                    __moveVotingPower(votingDelegates[_from], votingDelegates[_to], _value);
                    // emit an improved transfer event
                    emit Transferred(msg.sender, _from, _to, _value);
                    // emit an ERC20 transfer event
                    emit Transfer(_from, _to, _value);
                  }
                  /**
                   * @notice Approves address called `_spender` to transfer some amount
                   *      of tokens on behalf of the owner
                   *
                   * @dev ERC20 `function approve(address _spender, uint256 _value) public returns (bool success)`
                   *
                   * @dev Caller must not necessarily own any tokens to grant the permission
                   *
                   * @param _spender an address approved by the caller (token owner)
                   *      to spend some tokens on its behalf
                   * @param _value an amount of tokens spender `_spender` is allowed to
                   *      transfer on behalf of the token owner
                   * @return success true on success, throws otherwise
                   */
                  function approve(address _spender, uint256 _value) public returns (bool success) {
                    // non-zero spender address check - Zeppelin
                    // obviously, zero spender address is a client mistake
                    // it's not part of ERC20 standard but it's reasonable to fail fast
                    require(_spender != address(0), "ERC20: approve to the zero address"); // Zeppelin msg
                    // read old approval value to emmit an improved event (ISBN:978-1-7281-3027-9)
                    uint256 _oldValue = transferAllowances[msg.sender][_spender];
                    // perform an operation: write value requested into the storage
                    transferAllowances[msg.sender][_spender] = _value;
                    // emit an improved atomic approve event (ISBN:978-1-7281-3027-9)
                    emit Approved(msg.sender, _spender, _oldValue, _value);
                    // emit an ERC20 approval event
                    emit Approval(msg.sender, _spender, _value);
                    // operation successful, return true
                    return true;
                  }
                  /**
                   * @notice Returns the amount which _spender is still allowed to withdraw from _owner.
                   *
                   * @dev ERC20 `function allowance(address _owner, address _spender) public view returns (uint256 remaining)`
                   *
                   * @dev A function to check an amount of tokens owner approved
                   *      to transfer on its behalf by some other address called "spender"
                   *
                   * @param _owner an address which approves transferring some tokens on its behalf
                   * @param _spender an address approved to transfer some tokens on behalf
                   * @return remaining an amount of tokens approved address `_spender` can transfer on behalf
                   *      of token owner `_owner`
                   */
                  function allowance(address _owner, address _spender) public view returns (uint256 remaining) {
                    // read the value from storage and return
                    return transferAllowances[_owner][_spender];
                  }
                  // ===== End: ERC20/ERC223/ERC777 functions =====
                  // ===== Start: Resolution for the Multiple Withdrawal Attack on ERC20 Tokens (ISBN:978-1-7281-3027-9) =====
                  /**
                   * @notice Increases the allowance granted to `spender` by the transaction sender
                   *
                   * @dev Resolution for the Multiple Withdrawal Attack on ERC20 Tokens (ISBN:978-1-7281-3027-9)
                   *
                   * @dev Throws if value to increase by is zero or too big and causes arithmetic overflow
                   *
                   * @param _spender an address approved by the caller (token owner)
                   *      to spend some tokens on its behalf
                   * @param _value an amount of tokens to increase by
                   * @return success true on success, throws otherwise
                   */
                  function increaseAllowance(address _spender, uint256 _value) public virtual returns (bool) {
                    // read current allowance value
                    uint256 currentVal = transferAllowances[msg.sender][_spender];
                    // non-zero _value and arithmetic overflow check on the allowance
                    require(currentVal + _value > currentVal, "zero value approval increase or arithmetic overflow");
                    // delegate call to `approve` with the new value
                    return approve(_spender, currentVal + _value);
                  }
                  /**
                   * @notice Decreases the allowance granted to `spender` by the caller.
                   *
                   * @dev Resolution for the Multiple Withdrawal Attack on ERC20 Tokens (ISBN:978-1-7281-3027-9)
                   *
                   * @dev Throws if value to decrease by is zero or is bigger than currently allowed value
                   *
                   * @param _spender an address approved by the caller (token owner)
                   *      to spend some tokens on its behalf
                   * @param _value an amount of tokens to decrease by
                   * @return success true on success, throws otherwise
                   */
                  function decreaseAllowance(address _spender, uint256 _value) public virtual returns (bool) {
                    // read current allowance value
                    uint256 currentVal = transferAllowances[msg.sender][_spender];
                    // non-zero _value check on the allowance
                    require(_value > 0, "zero value approval decrease");
                    // verify allowance decrease doesn't underflow
                    require(currentVal >= _value, "ERC20: decreased allowance below zero");
                    // delegate call to `approve` with the new value
                    return approve(_spender, currentVal - _value);
                  }
                  // ===== End: Resolution for the Multiple Withdrawal Attack on ERC20 Tokens (ISBN:978-1-7281-3027-9) =====
                  // ===== Start: Minting/burning extension =====
                  /**
                   * @dev Mints (creates) some tokens to address specified
                   * @dev The value specified is treated as is without taking
                   *      into account what `decimals` value is
                   * @dev Behaves effectively as `mintTo` function, allowing
                   *      to specify an address to mint tokens to
                   * @dev Requires sender to have `ROLE_TOKEN_CREATOR` permission
                   *
                   * @dev Throws on overflow, if totalSupply + _value doesn't fit into uint256
                   *
                   * @param _to an address to mint tokens to
                   * @param _value an amount of tokens to mint (create)
                   */
                  function mint(address _to, uint256 _value) public {
                    // check if caller has sufficient permissions to mint tokens
                    require(isSenderInRole(ROLE_TOKEN_CREATOR), "insufficient privileges (ROLE_TOKEN_CREATOR required)");
                    // non-zero recipient address check
                    require(_to != address(0), "ERC20: mint to the zero address"); // Zeppelin msg
                    // non-zero _value and arithmetic overflow check on the total supply
                    // this check automatically secures arithmetic overflow on the individual balance
                    require(totalSupply + _value > totalSupply, "zero value mint or arithmetic overflow");
                    // uint192 overflow check (required by voting delegation)
                    require(totalSupply + _value <= type(uint192).max, "total supply overflow (uint192)");
                    // perform mint:
                    // increase total amount of tokens value
                    totalSupply += _value;
                    // increase `_to` address balance
                    tokenBalances[_to] += _value;
                    // create voting power associated with the tokens minted
                    __moveVotingPower(address(0), votingDelegates[_to], _value);
                    // fire a minted event
                    emit Minted(msg.sender, _to, _value);
                    // emit an improved transfer event
                    emit Transferred(msg.sender, address(0), _to, _value);
                    // fire ERC20 compliant transfer event
                    emit Transfer(address(0), _to, _value);
                  }
                  /**
                   * @dev Burns (destroys) some tokens from the address specified
                   * @dev The value specified is treated as is without taking
                   *      into account what `decimals` value is
                   * @dev Behaves effectively as `burnFrom` function, allowing
                   *      to specify an address to burn tokens from
                   * @dev Requires sender to have `ROLE_TOKEN_DESTROYER` permission
                   *
                   * @param _from an address to burn some tokens from
                   * @param _value an amount of tokens to burn (destroy)
                   */
                  function burn(address _from, uint256 _value) public {
                    // check if caller has sufficient permissions to burn tokens
                    // and if not - check for possibility to burn own tokens or to burn on behalf
                    if(!isSenderInRole(ROLE_TOKEN_DESTROYER)) {
                      // if `_from` is equal to sender, require own burns feature to be enabled
                      // otherwise require burns on behalf feature to be enabled
                      require(_from == msg.sender && isFeatureEnabled(FEATURE_OWN_BURNS)
                           || _from != msg.sender && isFeatureEnabled(FEATURE_BURNS_ON_BEHALF),
                              _from == msg.sender? "burns are disabled": "burns on behalf are disabled");
                      // in case of burn on behalf
                      if(_from != msg.sender) {
                        // read allowance value - the amount of tokens allowed to be burnt - into the stack
                        uint256 _allowance = transferAllowances[_from][msg.sender];
                        // verify sender has an allowance to burn amount of tokens requested
                        require(_allowance >= _value, "ERC20: burn amount exceeds allowance"); // Zeppelin msg
                        // update allowance value on the stack
                        _allowance -= _value;
                        // update the allowance value in storage
                        transferAllowances[_from][msg.sender] = _allowance;
                        // emit an improved atomic approve event
                        emit Approved(msg.sender, _from, _allowance + _value, _allowance);
                        // emit an ERC20 approval event to reflect the decrease
                        emit Approval(_from, msg.sender, _allowance);
                      }
                    }
                    // at this point we know that either sender is ROLE_TOKEN_DESTROYER or
                    // we burn own tokens or on behalf (in latest case we already checked and updated allowances)
                    // we have left to execute balance checks and burning logic itself
                    // non-zero burn value check
                    require(_value != 0, "zero value burn");
                    // non-zero source address check - Zeppelin
                    require(_from != address(0), "ERC20: burn from the zero address"); // Zeppelin msg
                    // verify `_from` address has enough tokens to destroy
                    // (basically this is a arithmetic overflow check)
                    require(tokenBalances[_from] >= _value, "ERC20: burn amount exceeds balance"); // Zeppelin msg
                    // perform burn:
                    // decrease `_from` address balance
                    tokenBalances[_from] -= _value;
                    // decrease total amount of tokens value
                    totalSupply -= _value;
                    // destroy voting power associated with the tokens burnt
                    __moveVotingPower(votingDelegates[_from], address(0), _value);
                    // fire a burnt event
                    emit Burnt(msg.sender, _from, _value);
                    // emit an improved transfer event
                    emit Transferred(msg.sender, _from, address(0), _value);
                    // fire ERC20 compliant transfer event
                    emit Transfer(_from, address(0), _value);
                  }
                  // ===== End: Minting/burning extension =====
                  // ===== Start: DAO Support (Compound-like voting delegation) =====
                  /**
                   * @notice Gets current voting power of the account `_of`
                   * @param _of the address of account to get voting power of
                   * @return current cumulative voting power of the account,
                   *      sum of token balances of all its voting delegators
                   */
                  function getVotingPower(address _of) public view returns (uint256) {
                    // get a link to an array of voting power history records for an address specified
                    VotingPowerRecord[] storage history = votingPowerHistory[_of];
                    // lookup the history and return latest element
                    return history.length == 0? 0: history[history.length - 1].votingPower;
                  }
                  /**
                   * @notice Gets past voting power of the account `_of` at some block `_blockNum`
                   * @dev Throws if `_blockNum` is not in the past (not the finalized block)
                   * @param _of the address of account to get voting power of
                   * @param _blockNum block number to get the voting power at
                   * @return past cumulative voting power of the account,
                   *      sum of token balances of all its voting delegators at block number `_blockNum`
                   */
                  function getVotingPowerAt(address _of, uint256 _blockNum) public view returns (uint256) {
                    // make sure block number is not in the past (not the finalized block)
                    require(_blockNum < block.number, "not yet determined"); // Compound msg
                    // get a link to an array of voting power history records for an address specified
                    VotingPowerRecord[] storage history = votingPowerHistory[_of];
                    // if voting power history for the account provided is empty
                    if(history.length == 0) {
                      // than voting power is zero - return the result
                      return 0;
                    }
                    // check latest voting power history record block number:
                    // if history was not updated after the block of interest
                    if(history[history.length - 1].blockNumber <= _blockNum) {
                      // we're done - return last voting power record
                      return getVotingPower(_of);
                    }
                    // check first voting power history record block number:
                    // if history was never updated before the block of interest
                    if(history[0].blockNumber > _blockNum) {
                      // we're done - voting power at the block num of interest was zero
                      return 0;
                    }
                    // `votingPowerHistory[_of]` is an array ordered by `blockNumber`, ascending;
                    // apply binary search on `votingPowerHistory[_of]` to find such an entry number `i`, that
                    // `votingPowerHistory[_of][i].blockNumber <= _blockNum`, but in the same time
                    // `votingPowerHistory[_of][i + 1].blockNumber > _blockNum`
                    // return the result - voting power found at index `i`
                    return history[__binaryLookup(_of, _blockNum)].votingPower;
                  }
                  /**
                   * @dev Reads an entire voting power history array for the delegate specified
                   *
                   * @param _of delegate to query voting power history for
                   * @return voting power history array for the delegate of interest
                   */
                  function getVotingPowerHistory(address _of) public view returns(VotingPowerRecord[] memory) {
                    // return an entire array as memory
                    return votingPowerHistory[_of];
                  }
                  /**
                   * @dev Returns length of the voting power history array for the delegate specified;
                   *      useful since reading an entire array just to get its length is expensive (gas cost)
                   *
                   * @param _of delegate to query voting power history length for
                   * @return voting power history array length for the delegate of interest
                   */
                  function getVotingPowerHistoryLength(address _of) public view returns(uint256) {
                    // read array length and return
                    return votingPowerHistory[_of].length;
                  }
                  /**
                   * @notice Delegates voting power of the delegator `msg.sender` to the delegate `_to`
                   *
                   * @dev Accepts zero value address to delegate voting power to, effectively
                   *      removing the delegate in that case
                   *
                   * @param _to address to delegate voting power to
                   */
                  function delegate(address _to) public {
                    // verify delegations are enabled
                    require(isFeatureEnabled(FEATURE_DELEGATIONS), "delegations are disabled");
                    // delegate call to `__delegate`
                    __delegate(msg.sender, _to);
                  }
                  /**
                   * @notice Delegates voting power of the delegator (represented by its signature) to the delegate `_to`
                   *
                   * @dev Accepts zero value address to delegate voting power to, effectively
                   *      removing the delegate in that case
                   *
                   * @dev Compliant with EIP-712: Ethereum typed structured data hashing and signing,
                   *      see https://eips.ethereum.org/EIPS/eip-712
                   *
                   * @param _to address to delegate voting power to
                   * @param _nonce nonce used to construct the signature, and used to validate it;
                   *      nonce is increased by one after successful signature validation and vote delegation
                   * @param _exp signature expiration time
                   * @param v the recovery byte of the signature
                   * @param r half of the ECDSA signature pair
                   * @param s half of the ECDSA signature pair
                   */
                  function delegateWithSig(address _to, uint256 _nonce, uint256 _exp, uint8 v, bytes32 r, bytes32 s) public {
                    // verify delegations on behalf are enabled
                    require(isFeatureEnabled(FEATURE_DELEGATIONS_ON_BEHALF), "delegations on behalf are disabled");
                    // build the EIP-712 contract domain separator
                    bytes32 domainSeparator = keccak256(abi.encode(DOMAIN_TYPEHASH, keccak256(bytes(name)), block.chainid, address(this)));
                    // build the EIP-712 hashStruct of the delegation message
                    bytes32 hashStruct = keccak256(abi.encode(DELEGATION_TYPEHASH, _to, _nonce, _exp));
                    // calculate the EIP-712 digest "\\x19\\x01" ‖ domainSeparator ‖ hashStruct(message)
                    bytes32 digest = keccak256(abi.encodePacked("\\x19\\x01", domainSeparator, hashStruct));
                    // recover the address who signed the message with v, r, s
                    address signer = ecrecover(digest, v, r, s);
                    // perform message integrity and security validations
                    require(signer != address(0), "invalid signature"); // Compound msg
                    require(_nonce == nonces[signer], "invalid nonce"); // Compound msg
                    require(block.timestamp < _exp, "signature expired"); // Compound msg
                    // update the nonce for that particular signer to avoid replay attack
                    nonces[signer]++;
                    // delegate call to `__delegate` - execute the logic required
                    __delegate(signer, _to);
                  }
                  /**
                   * @dev Auxiliary function to delegate delegator's `_from` voting power to the delegate `_to`
                   * @dev Writes to `votingDelegates` and `votingPowerHistory` mappings
                   *
                   * @param _from delegator who delegates his voting power
                   * @param _to delegate who receives the voting power
                   */
                  function __delegate(address _from, address _to) private {
                    // read current delegate to be replaced by a new one
                    address _fromDelegate = votingDelegates[_from];
                    // read current voting power (it is equal to token balance)
                    uint256 _value = tokenBalances[_from];
                    // reassign voting delegate to `_to`
                    votingDelegates[_from] = _to;
                    // update voting power for `_fromDelegate` and `_to`
                    __moveVotingPower(_fromDelegate, _to, _value);
                    // emit an event
                    emit DelegateChanged(_from, _fromDelegate, _to);
                  }
                  /**
                   * @dev Auxiliary function to move voting power `_value`
                   *      from delegate `_from` to the delegate `_to`
                   *
                   * @dev Doesn't have any effect if `_from == _to`, or if `_value == 0`
                   *
                   * @param _from delegate to move voting power from
                   * @param _to delegate to move voting power to
                   * @param _value voting power to move from `_from` to `_to`
                   */
                  function __moveVotingPower(address _from, address _to, uint256 _value) private {
                    // if there is no move (`_from == _to`) or there is nothing to move (`_value == 0`)
                    if(_from == _to || _value == 0) {
                      // return silently with no action
                      return;
                    }
                    // if source address is not zero - decrease its voting power
                    if(_from != address(0)) {
                      // read current source address voting power
                      uint256 _fromVal = getVotingPower(_from);
                      // calculate decreased voting power
                      // underflow is not possible by design:
                      // voting power is limited by token balance which is checked by the callee
                      uint256 _toVal = _fromVal - _value;
                      // update source voting power from `_fromVal` to `_toVal`
                      __updateVotingPower(_from, _fromVal, _toVal);
                    }
                    // if destination address is not zero - increase its voting power
                    if(_to != address(0)) {
                      // read current destination address voting power
                      uint256 _fromVal = getVotingPower(_to);
                      // calculate increased voting power
                      // overflow is not possible by design:
                      // max token supply limits the cumulative voting power
                      uint256 _toVal = _fromVal + _value;
                      // update destination voting power from `_fromVal` to `_toVal`
                      __updateVotingPower(_to, _fromVal, _toVal);
                    }
                  }
                  /**
                   * @dev Auxiliary function to update voting power of the delegate `_of`
                   *      from value `_fromVal` to value `_toVal`
                   *
                   * @param _of delegate to update its voting power
                   * @param _fromVal old voting power of the delegate
                   * @param _toVal new voting power of the delegate
                   */
                  function __updateVotingPower(address _of, uint256 _fromVal, uint256 _toVal) private {
                    // get a link to an array of voting power history records for an address specified
                    VotingPowerRecord[] storage history = votingPowerHistory[_of];
                    // if there is an existing voting power value stored for current block
                    if(history.length != 0 && history[history.length - 1].blockNumber == block.number) {
                      // update voting power which is already stored in the current block
                      history[history.length - 1].votingPower = uint192(_toVal);
                    }
                    // otherwise - if there is no value stored for current block
                    else {
                      // add new element into array representing the value for current block
                      history.push(VotingPowerRecord(uint64(block.number), uint192(_toVal)));
                    }
                    // emit an event
                    emit VotingPowerChanged(_of, _fromVal, _toVal);
                  }
                  /**
                   * @dev Auxiliary function to lookup an element in a sorted (asc) array of elements
                   *
                   * @dev This function finds the closest element in an array to the value
                   *      of interest (not exceeding that value) and returns its index within an array
                   *
                   * @dev An array to search in is `votingPowerHistory[_to][i].blockNumber`,
                   *      it is sorted in ascending order (blockNumber increases)
                   *
                   * @param _to an address of the delegate to get an array for
                   * @param n value of interest to look for
                   * @return an index of the closest element in an array to the value
                   *      of interest (not exceeding that value)
                   */
                  function __binaryLookup(address _to, uint256 n) private view returns(uint256) {
                    // get a link to an array of voting power history records for an address specified
                    VotingPowerRecord[] storage history = votingPowerHistory[_to];
                    // left bound of the search interval, originally start of the array
                    uint256 i = 0;
                    // right bound of the search interval, originally end of the array
                    uint256 j = history.length - 1;
                    // the iteration process narrows down the bounds by
                    // splitting the interval in a half oce per each iteration
                    while(j > i) {
                      // get an index in the middle of the interval [i, j]
                      uint256 k = j - (j - i) / 2;
                      // read an element to compare it with the value of interest
                      VotingPowerRecord memory cp = history[k];
                      // if we've got a strict equal - we're lucky and done
                      if(cp.blockNumber == n) {
                        // just return the result - index `k`
                        return k;
                      }
                      // if the value of interest is bigger - move left bound to the middle
                      else if (cp.blockNumber < n) {
                        // move left bound `i` to the middle position `k`
                        i = k;
                      }
                      // otherwise, when the value of interest is smaller - move right bound to the middle
                      else {
                        // move right bound `j` to the middle position `k - 1`:
                        // element at position `k` is bigger and cannot be the result
                        j = k - 1;
                      }
                    }
                    // reaching that point means no exact match found
                    // since we're interested in the element which is not bigger than the
                    // element of interest, we return the lower bound `i`
                    return i;
                  }
                }
                // ===== End: DAO Support (Compound-like voting delegation) =====
                // SPDX-License-Identifier: MIT
                pragma solidity 0.8.1;
                /**
                 * @title Access Control List
                 *
                 * @notice Access control smart contract provides an API to check
                 *      if specific operation is permitted globally and/or
                 *      if particular user has a permission to execute it.
                 *
                 * @notice It deals with two main entities: features and roles.
                 *
                 * @notice Features are designed to be used to enable/disable specific
                 *      functions (public functions) of the smart contract for everyone.
                 * @notice User roles are designed to restrict access to specific
                 *      functions (restricted functions) of the smart contract to some users.
                 *
                 * @notice Terms "role", "permissions" and "set of permissions" have equal meaning
                 *      in the documentation text and may be used interchangeably.
                 * @notice Terms "permission", "single permission" implies only one permission bit set.
                 *
                 * @dev This smart contract is designed to be inherited by other
                 *      smart contracts which require access control management capabilities.
                 *
                 * @author Basil Gorin
                 */
                contract AccessControl {
                  /**
                   * @notice Access manager is responsible for assigning the roles to users,
                   *      enabling/disabling global features of the smart contract
                   * @notice Access manager can add, remove and update user roles,
                   *      remove and update global features
                   *
                   * @dev Role ROLE_ACCESS_MANAGER allows modifying user roles and global features
                   * @dev Role ROLE_ACCESS_MANAGER has single bit at position 255 enabled
                   */
                  uint256 public constant ROLE_ACCESS_MANAGER = 0x8000000000000000000000000000000000000000000000000000000000000000;
                  /**
                   * @dev Bitmask representing all the possible permissions (super admin role)
                   * @dev Has all the bits are enabled (2^256 - 1 value)
                   */
                  uint256 private constant FULL_PRIVILEGES_MASK = type(uint256).max; // before 0.8.0: uint256(-1) overflows to 0xFFFF...
                  /**
                   * @notice Privileged addresses with defined roles/permissions
                   * @notice In the context of ERC20/ERC721 tokens these can be permissions to
                   *      allow minting or burning tokens, transferring on behalf and so on
                   *
                   * @dev Maps user address to the permissions bitmask (role), where each bit
                   *      represents a permission
                   * @dev Bitmask 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
                   *      represents all possible permissions
                   * @dev Zero address mapping represents global features of the smart contract
                   */
                  mapping(address => uint256) public userRoles;
                  /**
                   * @dev Fired in updateRole() and updateFeatures()
                   *
                   * @param _by operator which called the function
                   * @param _to address which was granted/revoked permissions
                   * @param _requested permissions requested
                   * @param _actual permissions effectively set
                   */
                  event RoleUpdated(address indexed _by, address indexed _to, uint256 _requested, uint256 _actual);
                  /**
                   * @notice Creates an access control instance,
                   *      setting contract creator to have full privileges
                   */
                  constructor() {
                    // contract creator has full privileges
                    userRoles[msg.sender] = FULL_PRIVILEGES_MASK;
                  }
                  /**
                   * @notice Retrieves globally set of features enabled
                   *
                   * @dev Auxiliary getter function to maintain compatibility with previous
                   *      versions of the Access Control List smart contract, where
                   *      features was a separate uint256 public field
                   *
                   * @return 256-bit bitmask of the features enabled
                   */
                  function features() public view returns(uint256) {
                    // according to new design features are stored in zero address
                    // mapping of `userRoles` structure
                    return userRoles[address(0)];
                  }
                  /**
                   * @notice Updates set of the globally enabled features (`features`),
                   *      taking into account sender's permissions
                   *
                   * @dev Requires transaction sender to have `ROLE_ACCESS_MANAGER` permission
                   * @dev Function is left for backward compatibility with older versions
                   *
                   * @param _mask bitmask representing a set of features to enable/disable
                   */
                  function updateFeatures(uint256 _mask) public {
                    // delegate call to `updateRole`
                    updateRole(address(0), _mask);
                  }
                  /**
                   * @notice Updates set of permissions (role) for a given user,
                   *      taking into account sender's permissions.
                   *
                   * @dev Setting role to zero is equivalent to removing an all permissions
                   * @dev Setting role to `FULL_PRIVILEGES_MASK` is equivalent to
                   *      copying senders' permissions (role) to the user
                   * @dev Requires transaction sender to have `ROLE_ACCESS_MANAGER` permission
                   *
                   * @param operator address of a user to alter permissions for or zero
                   *      to alter global features of the smart contract
                   * @param role bitmask representing a set of permissions to
                   *      enable/disable for a user specified
                   */
                  function updateRole(address operator, uint256 role) public {
                    // caller must have a permission to update user roles
                    require(isSenderInRole(ROLE_ACCESS_MANAGER), "insufficient privileges (ROLE_ACCESS_MANAGER required)");
                    // evaluate the role and reassign it
                    userRoles[operator] = evaluateBy(msg.sender, userRoles[operator], role);
                    // fire an event
                    emit RoleUpdated(msg.sender, operator, role, userRoles[operator]);
                  }
                  /**
                   * @notice Determines the permission bitmask an operator can set on the
                   *      target permission set
                   * @notice Used to calculate the permission bitmask to be set when requested
                   *     in `updateRole` and `updateFeatures` functions
                   *
                   * @dev Calculated based on:
                   *      1) operator's own permission set read from userRoles[operator]
                   *      2) target permission set - what is already set on the target
                   *      3) desired permission set - what do we want set target to
                   *
                   * @dev Corner cases:
                   *      1) Operator is super admin and its permission set is `FULL_PRIVILEGES_MASK`:
                   *        `desired` bitset is returned regardless of the `target` permission set value
                   *        (what operator sets is what they get)
                   *      2) Operator with no permissions (zero bitset):
                   *        `target` bitset is returned regardless of the `desired` value
                   *        (operator has no authority and cannot modify anything)
                   *
                   * @dev Example:
                   *      Consider an operator with the permissions bitmask     00001111
                   *      is about to modify the target permission set          01010101
                   *      Operator wants to set that permission set to          00110011
                   *      Based on their role, an operator has the permissions
                   *      to update only lowest 4 bits on the target, meaning that
                   *      high 4 bits of the target set in this example is left
                   *      unchanged and low 4 bits get changed as desired:      01010011
                   *
                   * @param operator address of the contract operator which is about to set the permissions
                   * @param target input set of permissions to operator is going to modify
                   * @param desired desired set of permissions operator would like to set
                   * @return resulting set of permissions given operator will set
                   */
                  function evaluateBy(address operator, uint256 target, uint256 desired) public view returns(uint256) {
                    // read operator's permissions
                    uint256 p = userRoles[operator];
                    // taking into account operator's permissions,
                    // 1) enable the permissions desired on the `target`
                    target |= p & desired;
                    // 2) disable the permissions desired on the `target`
                    target &= FULL_PRIVILEGES_MASK ^ (p & (FULL_PRIVILEGES_MASK ^ desired));
                    // return calculated result
                    return target;
                  }
                  /**
                   * @notice Checks if requested set of features is enabled globally on the contract
                   *
                   * @param required set of features to check against
                   * @return true if all the features requested are enabled, false otherwise
                   */
                  function isFeatureEnabled(uint256 required) public view returns(bool) {
                    // delegate call to `__hasRole`, passing `features` property
                    return __hasRole(features(), required);
                  }
                  /**
                   * @notice Checks if transaction sender `msg.sender` has all the permissions required
                   *
                   * @param required set of permissions (role) to check against
                   * @return true if all the permissions requested are enabled, false otherwise
                   */
                  function isSenderInRole(uint256 required) public view returns(bool) {
                    // delegate call to `isOperatorInRole`, passing transaction sender
                    return isOperatorInRole(msg.sender, required);
                  }
                  /**
                   * @notice Checks if operator has all the permissions (role) required
                   *
                   * @param operator address of the user to check role for
                   * @param required set of permissions (role) to check
                   * @return true if all the permissions requested are enabled, false otherwise
                   */
                  function isOperatorInRole(address operator, uint256 required) public view returns(bool) {
                    // delegate call to `__hasRole`, passing operator's permissions (role)
                    return __hasRole(userRoles[operator], required);
                  }
                  /**
                   * @dev Checks if role `actual` contains all the permissions required `required`
                   *
                   * @param actual existent role
                   * @param required required role
                   * @return true if actual has required role (all permissions), false otherwise
                   */
                  function __hasRole(uint256 actual, uint256 required) internal pure returns(bool) {
                    // check the bitmask for the role required and return the result
                    return actual & required == required;
                  }
                }
                // SPDX-License-Identifier: MIT
                pragma solidity 0.8.1;
                /**
                 * @title Address Utils
                 *
                 * @dev Utility library of inline functions on addresses
                 *
                 * @author Basil Gorin
                 */
                library AddressUtils {
                  /**
                   * @notice Checks if the target address is a contract
                   * @dev This function will return false if invoked during the constructor of a contract,
                   *      as the code is not actually created until after the constructor finishes.
                   * @param addr address to check
                   * @return whether the target address is a contract
                   */
                  function isContract(address addr) internal view returns (bool) {
                    // a variable to load `extcodesize` to
                    uint256 size = 0;
                    // XXX Currently there is no better way to check if there is a contract in an address
                    // than to check the size of the code at that address.
                    // See https://ethereum.stackexchange.com/a/14016/36603 for more details about how this works.
                    // TODO: Check this again before the Serenity release, because all addresses will be contracts.
                    // solium-disable-next-line security/no-inline-assembly
                    assembly {
                      // retrieve the size of the code at address `addr`
                      size := extcodesize(addr)
                    }
                    // positive size indicates a smart contract address
                    return size > 0;
                  }
                }
                

                File 3 of 4: Proxy
                pragma solidity ^0.5.3;
                
                /// @title Proxy - Generic proxy contract allows to execute all transactions applying the code of a master contract.
                /// @author Stefan George - <[email protected]>
                /// @author Richard Meissner - <[email protected]>
                contract Proxy {
                
                    // masterCopy always needs to be first declared variable, to ensure that it is at the same location in the contracts to which calls are delegated.
                    // To reduce deployment costs this variable is internal and needs to be retrieved via `getStorageAt`
                    address internal masterCopy;
                
                    /// @dev Constructor function sets address of master copy contract.
                    /// @param _masterCopy Master copy address.
                    constructor(address _masterCopy)
                        public
                    {
                        require(_masterCopy != address(0), "Invalid master copy address provided");
                        masterCopy = _masterCopy;
                    }
                
                    /// @dev Fallback function forwards all transactions and returns all received return data.
                    function ()
                        external
                        payable
                    {
                        // solium-disable-next-line security/no-inline-assembly
                        assembly {
                            let masterCopy := and(sload(0), 0xffffffffffffffffffffffffffffffffffffffff)
                            // 0xa619486e == keccak("masterCopy()"). The value is right padded to 32-bytes with 0s
                            if eq(calldataload(0), 0xa619486e00000000000000000000000000000000000000000000000000000000) {
                                mstore(0, masterCopy)
                                return(0, 0x20)
                            }
                            calldatacopy(0, 0, calldatasize())
                            let success := delegatecall(gas, masterCopy, 0, calldatasize(), 0, 0)
                            returndatacopy(0, 0, returndatasize())
                            if eq(success, 0) { revert(0, returndatasize()) }
                            return(0, returndatasize())
                        }
                    }
                }

                File 4 of 4: GnosisSafe
                // SPDX-License-Identifier: LGPL-3.0-only
                pragma solidity >=0.7.0 <0.9.0;
                import "./base/ModuleManager.sol";
                import "./base/OwnerManager.sol";
                import "./base/FallbackManager.sol";
                import "./base/GuardManager.sol";
                import "./common/EtherPaymentFallback.sol";
                import "./common/Singleton.sol";
                import "./common/SignatureDecoder.sol";
                import "./common/SecuredTokenTransfer.sol";
                import "./common/StorageAccessible.sol";
                import "./interfaces/ISignatureValidator.sol";
                import "./external/GnosisSafeMath.sol";
                /// @title Gnosis Safe - A multisignature wallet with support for confirmations using signed messages based on ERC191.
                /// @author Stefan George - <[email protected]>
                /// @author Richard Meissner - <[email protected]>
                contract GnosisSafe is
                    EtherPaymentFallback,
                    Singleton,
                    ModuleManager,
                    OwnerManager,
                    SignatureDecoder,
                    SecuredTokenTransfer,
                    ISignatureValidatorConstants,
                    FallbackManager,
                    StorageAccessible,
                    GuardManager
                {
                    using GnosisSafeMath for uint256;
                    string public constant VERSION = "1.3.0";
                    // keccak256(
                    //     "EIP712Domain(uint256 chainId,address verifyingContract)"
                    // );
                    bytes32 private constant DOMAIN_SEPARATOR_TYPEHASH = 0x47e79534a245952e8b16893a336b85a3d9ea9fa8c573f3d803afb92a79469218;
                    // keccak256(
                    //     "SafeTx(address to,uint256 value,bytes data,uint8 operation,uint256 safeTxGas,uint256 baseGas,uint256 gasPrice,address gasToken,address refundReceiver,uint256 nonce)"
                    // );
                    bytes32 private constant SAFE_TX_TYPEHASH = 0xbb8310d486368db6bd6f849402fdd73ad53d316b5a4b2644ad6efe0f941286d8;
                    event SafeSetup(address indexed initiator, address[] owners, uint256 threshold, address initializer, address fallbackHandler);
                    event ApproveHash(bytes32 indexed approvedHash, address indexed owner);
                    event SignMsg(bytes32 indexed msgHash);
                    event ExecutionFailure(bytes32 txHash, uint256 payment);
                    event ExecutionSuccess(bytes32 txHash, uint256 payment);
                    uint256 public nonce;
                    bytes32 private _deprecatedDomainSeparator;
                    // Mapping to keep track of all message hashes that have been approve by ALL REQUIRED owners
                    mapping(bytes32 => uint256) public signedMessages;
                    // Mapping to keep track of all hashes (message or transaction) that have been approve by ANY owners
                    mapping(address => mapping(bytes32 => uint256)) public approvedHashes;
                    // This constructor ensures that this contract can only be used as a master copy for Proxy contracts
                    constructor() {
                        // By setting the threshold it is not possible to call setup anymore,
                        // so we create a Safe with 0 owners and threshold 1.
                        // This is an unusable Safe, perfect for the singleton
                        threshold = 1;
                    }
                    /// @dev Setup function sets initial storage of contract.
                    /// @param _owners List of Safe owners.
                    /// @param _threshold Number of required confirmations for a Safe transaction.
                    /// @param to Contract address for optional delegate call.
                    /// @param data Data payload for optional delegate call.
                    /// @param fallbackHandler Handler for fallback calls to this contract
                    /// @param paymentToken Token that should be used for the payment (0 is ETH)
                    /// @param payment Value that should be paid
                    /// @param paymentReceiver Adddress that should receive the payment (or 0 if tx.origin)
                    function setup(
                        address[] calldata _owners,
                        uint256 _threshold,
                        address to,
                        bytes calldata data,
                        address fallbackHandler,
                        address paymentToken,
                        uint256 payment,
                        address payable paymentReceiver
                    ) external {
                        // setupOwners checks if the Threshold is already set, therefore preventing that this method is called twice
                        setupOwners(_owners, _threshold);
                        if (fallbackHandler != address(0)) internalSetFallbackHandler(fallbackHandler);
                        // As setupOwners can only be called if the contract has not been initialized we don't need a check for setupModules
                        setupModules(to, data);
                        if (payment > 0) {
                            // To avoid running into issues with EIP-170 we reuse the handlePayment function (to avoid adjusting code of that has been verified we do not adjust the method itself)
                            // baseGas = 0, gasPrice = 1 and gas = payment => amount = (payment + 0) * 1 = payment
                            handlePayment(payment, 0, 1, paymentToken, paymentReceiver);
                        }
                        emit SafeSetup(msg.sender, _owners, _threshold, to, fallbackHandler);
                    }
                    /// @dev Allows to execute a Safe transaction confirmed by required number of owners and then pays the account that submitted the transaction.
                    ///      Note: The fees are always transferred, even if the user transaction fails.
                    /// @param to Destination address of Safe transaction.
                    /// @param value Ether value of Safe transaction.
                    /// @param data Data payload of Safe transaction.
                    /// @param operation Operation type of Safe transaction.
                    /// @param safeTxGas Gas that should be used for the Safe transaction.
                    /// @param baseGas Gas costs that are independent of the transaction execution(e.g. base transaction fee, signature check, payment of the refund)
                    /// @param gasPrice Gas price that should be used for the payment calculation.
                    /// @param gasToken Token address (or 0 if ETH) that is used for the payment.
                    /// @param refundReceiver Address of receiver of gas payment (or 0 if tx.origin).
                    /// @param signatures Packed signature data ({bytes32 r}{bytes32 s}{uint8 v})
                    function execTransaction(
                        address to,
                        uint256 value,
                        bytes calldata data,
                        Enum.Operation operation,
                        uint256 safeTxGas,
                        uint256 baseGas,
                        uint256 gasPrice,
                        address gasToken,
                        address payable refundReceiver,
                        bytes memory signatures
                    ) public payable virtual returns (bool success) {
                        bytes32 txHash;
                        // Use scope here to limit variable lifetime and prevent `stack too deep` errors
                        {
                            bytes memory txHashData =
                                encodeTransactionData(
                                    // Transaction info
                                    to,
                                    value,
                                    data,
                                    operation,
                                    safeTxGas,
                                    // Payment info
                                    baseGas,
                                    gasPrice,
                                    gasToken,
                                    refundReceiver,
                                    // Signature info
                                    nonce
                                );
                            // Increase nonce and execute transaction.
                            nonce++;
                            txHash = keccak256(txHashData);
                            checkSignatures(txHash, txHashData, signatures);
                        }
                        address guard = getGuard();
                        {
                            if (guard != address(0)) {
                                Guard(guard).checkTransaction(
                                    // Transaction info
                                    to,
                                    value,
                                    data,
                                    operation,
                                    safeTxGas,
                                    // Payment info
                                    baseGas,
                                    gasPrice,
                                    gasToken,
                                    refundReceiver,
                                    // Signature info
                                    signatures,
                                    msg.sender
                                );
                            }
                        }
                        // We require some gas to emit the events (at least 2500) after the execution and some to perform code until the execution (500)
                        // We also include the 1/64 in the check that is not send along with a call to counteract potential shortings because of EIP-150
                        require(gasleft() >= ((safeTxGas * 64) / 63).max(safeTxGas + 2500) + 500, "GS010");
                        // Use scope here to limit variable lifetime and prevent `stack too deep` errors
                        {
                            uint256 gasUsed = gasleft();
                            // If the gasPrice is 0 we assume that nearly all available gas can be used (it is always more than safeTxGas)
                            // We only substract 2500 (compared to the 3000 before) to ensure that the amount passed is still higher than safeTxGas
                            success = execute(to, value, data, operation, gasPrice == 0 ? (gasleft() - 2500) : safeTxGas);
                            gasUsed = gasUsed.sub(gasleft());
                            // If no safeTxGas and no gasPrice was set (e.g. both are 0), then the internal tx is required to be successful
                            // This makes it possible to use `estimateGas` without issues, as it searches for the minimum gas where the tx doesn't revert
                            require(success || safeTxGas != 0 || gasPrice != 0, "GS013");
                            // We transfer the calculated tx costs to the tx.origin to avoid sending it to intermediate contracts that have made calls
                            uint256 payment = 0;
                            if (gasPrice > 0) {
                                payment = handlePayment(gasUsed, baseGas, gasPrice, gasToken, refundReceiver);
                            }
                            if (success) emit ExecutionSuccess(txHash, payment);
                            else emit ExecutionFailure(txHash, payment);
                        }
                        {
                            if (guard != address(0)) {
                                Guard(guard).checkAfterExecution(txHash, success);
                            }
                        }
                    }
                    function handlePayment(
                        uint256 gasUsed,
                        uint256 baseGas,
                        uint256 gasPrice,
                        address gasToken,
                        address payable refundReceiver
                    ) private returns (uint256 payment) {
                        // solhint-disable-next-line avoid-tx-origin
                        address payable receiver = refundReceiver == address(0) ? payable(tx.origin) : refundReceiver;
                        if (gasToken == address(0)) {
                            // For ETH we will only adjust the gas price to not be higher than the actual used gas price
                            payment = gasUsed.add(baseGas).mul(gasPrice < tx.gasprice ? gasPrice : tx.gasprice);
                            require(receiver.send(payment), "GS011");
                        } else {
                            payment = gasUsed.add(baseGas).mul(gasPrice);
                            require(transferToken(gasToken, receiver, payment), "GS012");
                        }
                    }
                    /**
                     * @dev Checks whether the signature provided is valid for the provided data, hash. Will revert otherwise.
                     * @param dataHash Hash of the data (could be either a message hash or transaction hash)
                     * @param data That should be signed (this is passed to an external validator contract)
                     * @param signatures Signature data that should be verified. Can be ECDSA signature, contract signature (EIP-1271) or approved hash.
                     */
                    function checkSignatures(
                        bytes32 dataHash,
                        bytes memory data,
                        bytes memory signatures
                    ) public view {
                        // Load threshold to avoid multiple storage loads
                        uint256 _threshold = threshold;
                        // Check that a threshold is set
                        require(_threshold > 0, "GS001");
                        checkNSignatures(dataHash, data, signatures, _threshold);
                    }
                    /**
                     * @dev Checks whether the signature provided is valid for the provided data, hash. Will revert otherwise.
                     * @param dataHash Hash of the data (could be either a message hash or transaction hash)
                     * @param data That should be signed (this is passed to an external validator contract)
                     * @param signatures Signature data that should be verified. Can be ECDSA signature, contract signature (EIP-1271) or approved hash.
                     * @param requiredSignatures Amount of required valid signatures.
                     */
                    function checkNSignatures(
                        bytes32 dataHash,
                        bytes memory data,
                        bytes memory signatures,
                        uint256 requiredSignatures
                    ) public view {
                        // Check that the provided signature data is not too short
                        require(signatures.length >= requiredSignatures.mul(65), "GS020");
                        // There cannot be an owner with address 0.
                        address lastOwner = address(0);
                        address currentOwner;
                        uint8 v;
                        bytes32 r;
                        bytes32 s;
                        uint256 i;
                        for (i = 0; i < requiredSignatures; i++) {
                            (v, r, s) = signatureSplit(signatures, i);
                            if (v == 0) {
                                // If v is 0 then it is a contract signature
                                // When handling contract signatures the address of the contract is encoded into r
                                currentOwner = address(uint160(uint256(r)));
                                // Check that signature data pointer (s) is not pointing inside the static part of the signatures bytes
                                // This check is not completely accurate, since it is possible that more signatures than the threshold are send.
                                // Here we only check that the pointer is not pointing inside the part that is being processed
                                require(uint256(s) >= requiredSignatures.mul(65), "GS021");
                                // Check that signature data pointer (s) is in bounds (points to the length of data -> 32 bytes)
                                require(uint256(s).add(32) <= signatures.length, "GS022");
                                // Check if the contract signature is in bounds: start of data is s + 32 and end is start + signature length
                                uint256 contractSignatureLen;
                                // solhint-disable-next-line no-inline-assembly
                                assembly {
                                    contractSignatureLen := mload(add(add(signatures, s), 0x20))
                                }
                                require(uint256(s).add(32).add(contractSignatureLen) <= signatures.length, "GS023");
                                // Check signature
                                bytes memory contractSignature;
                                // solhint-disable-next-line no-inline-assembly
                                assembly {
                                    // The signature data for contract signatures is appended to the concatenated signatures and the offset is stored in s
                                    contractSignature := add(add(signatures, s), 0x20)
                                }
                                require(ISignatureValidator(currentOwner).isValidSignature(data, contractSignature) == EIP1271_MAGIC_VALUE, "GS024");
                            } else if (v == 1) {
                                // If v is 1 then it is an approved hash
                                // When handling approved hashes the address of the approver is encoded into r
                                currentOwner = address(uint160(uint256(r)));
                                // Hashes are automatically approved by the sender of the message or when they have been pre-approved via a separate transaction
                                require(msg.sender == currentOwner || approvedHashes[currentOwner][dataHash] != 0, "GS025");
                            } else if (v > 30) {
                                // If v > 30 then default va (27,28) has been adjusted for eth_sign flow
                                // To support eth_sign and similar we adjust v and hash the messageHash with the Ethereum message prefix before applying ecrecover
                                currentOwner = ecrecover(keccak256(abi.encodePacked("\\x19Ethereum Signed Message:\
                32", dataHash)), v - 4, r, s);
                            } else {
                                // Default is the ecrecover flow with the provided data hash
                                // Use ecrecover with the messageHash for EOA signatures
                                currentOwner = ecrecover(dataHash, v, r, s);
                            }
                            require(currentOwner > lastOwner && owners[currentOwner] != address(0) && currentOwner != SENTINEL_OWNERS, "GS026");
                            lastOwner = currentOwner;
                        }
                    }
                    /// @dev Allows to estimate a Safe transaction.
                    ///      This method is only meant for estimation purpose, therefore the call will always revert and encode the result in the revert data.
                    ///      Since the `estimateGas` function includes refunds, call this method to get an estimated of the costs that are deducted from the safe with `execTransaction`
                    /// @param to Destination address of Safe transaction.
                    /// @param value Ether value of Safe transaction.
                    /// @param data Data payload of Safe transaction.
                    /// @param operation Operation type of Safe transaction.
                    /// @return Estimate without refunds and overhead fees (base transaction and payload data gas costs).
                    /// @notice Deprecated in favor of common/StorageAccessible.sol and will be removed in next version.
                    function requiredTxGas(
                        address to,
                        uint256 value,
                        bytes calldata data,
                        Enum.Operation operation
                    ) external returns (uint256) {
                        uint256 startGas = gasleft();
                        // We don't provide an error message here, as we use it to return the estimate
                        require(execute(to, value, data, operation, gasleft()));
                        uint256 requiredGas = startGas - gasleft();
                        // Convert response to string and return via error message
                        revert(string(abi.encodePacked(requiredGas)));
                    }
                    /**
                     * @dev Marks a hash as approved. This can be used to validate a hash that is used by a signature.
                     * @param hashToApprove The hash that should be marked as approved for signatures that are verified by this contract.
                     */
                    function approveHash(bytes32 hashToApprove) external {
                        require(owners[msg.sender] != address(0), "GS030");
                        approvedHashes[msg.sender][hashToApprove] = 1;
                        emit ApproveHash(hashToApprove, msg.sender);
                    }
                    /// @dev Returns the chain id used by this contract.
                    function getChainId() public view returns (uint256) {
                        uint256 id;
                        // solhint-disable-next-line no-inline-assembly
                        assembly {
                            id := chainid()
                        }
                        return id;
                    }
                    function domainSeparator() public view returns (bytes32) {
                        return keccak256(abi.encode(DOMAIN_SEPARATOR_TYPEHASH, getChainId(), this));
                    }
                    /// @dev Returns the bytes that are hashed to be signed by owners.
                    /// @param to Destination address.
                    /// @param value Ether value.
                    /// @param data Data payload.
                    /// @param operation Operation type.
                    /// @param safeTxGas Gas that should be used for the safe transaction.
                    /// @param baseGas Gas costs for that are independent of the transaction execution(e.g. base transaction fee, signature check, payment of the refund)
                    /// @param gasPrice Maximum gas price that should be used for this transaction.
                    /// @param gasToken Token address (or 0 if ETH) that is used for the payment.
                    /// @param refundReceiver Address of receiver of gas payment (or 0 if tx.origin).
                    /// @param _nonce Transaction nonce.
                    /// @return Transaction hash bytes.
                    function encodeTransactionData(
                        address to,
                        uint256 value,
                        bytes calldata data,
                        Enum.Operation operation,
                        uint256 safeTxGas,
                        uint256 baseGas,
                        uint256 gasPrice,
                        address gasToken,
                        address refundReceiver,
                        uint256 _nonce
                    ) public view returns (bytes memory) {
                        bytes32 safeTxHash =
                            keccak256(
                                abi.encode(
                                    SAFE_TX_TYPEHASH,
                                    to,
                                    value,
                                    keccak256(data),
                                    operation,
                                    safeTxGas,
                                    baseGas,
                                    gasPrice,
                                    gasToken,
                                    refundReceiver,
                                    _nonce
                                )
                            );
                        return abi.encodePacked(bytes1(0x19), bytes1(0x01), domainSeparator(), safeTxHash);
                    }
                    /// @dev Returns hash to be signed by owners.
                    /// @param to Destination address.
                    /// @param value Ether value.
                    /// @param data Data payload.
                    /// @param operation Operation type.
                    /// @param safeTxGas Fas that should be used for the safe transaction.
                    /// @param baseGas Gas costs for data used to trigger the safe transaction.
                    /// @param gasPrice Maximum gas price that should be used for this transaction.
                    /// @param gasToken Token address (or 0 if ETH) that is used for the payment.
                    /// @param refundReceiver Address of receiver of gas payment (or 0 if tx.origin).
                    /// @param _nonce Transaction nonce.
                    /// @return Transaction hash.
                    function getTransactionHash(
                        address to,
                        uint256 value,
                        bytes calldata data,
                        Enum.Operation operation,
                        uint256 safeTxGas,
                        uint256 baseGas,
                        uint256 gasPrice,
                        address gasToken,
                        address refundReceiver,
                        uint256 _nonce
                    ) public view returns (bytes32) {
                        return keccak256(encodeTransactionData(to, value, data, operation, safeTxGas, baseGas, gasPrice, gasToken, refundReceiver, _nonce));
                    }
                }
                // SPDX-License-Identifier: LGPL-3.0-only
                pragma solidity >=0.7.0 <0.9.0;
                import "../common/Enum.sol";
                /// @title Executor - A contract that can execute transactions
                /// @author Richard Meissner - <[email protected]>
                contract Executor {
                    function execute(
                        address to,
                        uint256 value,
                        bytes memory data,
                        Enum.Operation operation,
                        uint256 txGas
                    ) internal returns (bool success) {
                        if (operation == Enum.Operation.DelegateCall) {
                            // solhint-disable-next-line no-inline-assembly
                            assembly {
                                success := delegatecall(txGas, to, add(data, 0x20), mload(data), 0, 0)
                            }
                        } else {
                            // solhint-disable-next-line no-inline-assembly
                            assembly {
                                success := call(txGas, to, value, add(data, 0x20), mload(data), 0, 0)
                            }
                        }
                    }
                }
                // SPDX-License-Identifier: LGPL-3.0-only
                pragma solidity >=0.7.0 <0.9.0;
                import "../common/SelfAuthorized.sol";
                /// @title Fallback Manager - A contract that manages fallback calls made to this contract
                /// @author Richard Meissner - <[email protected]>
                contract FallbackManager is SelfAuthorized {
                    event ChangedFallbackHandler(address handler);
                    // keccak256("fallback_manager.handler.address")
                    bytes32 internal constant FALLBACK_HANDLER_STORAGE_SLOT = 0x6c9a6c4a39284e37ed1cf53d337577d14212a4870fb976a4366c693b939918d5;
                    function internalSetFallbackHandler(address handler) internal {
                        bytes32 slot = FALLBACK_HANDLER_STORAGE_SLOT;
                        // solhint-disable-next-line no-inline-assembly
                        assembly {
                            sstore(slot, handler)
                        }
                    }
                    /// @dev Allows to add a contract to handle fallback calls.
                    ///      Only fallback calls without value and with data will be forwarded.
                    ///      This can only be done via a Safe transaction.
                    /// @param handler contract to handle fallbacks calls.
                    function setFallbackHandler(address handler) public authorized {
                        internalSetFallbackHandler(handler);
                        emit ChangedFallbackHandler(handler);
                    }
                    // solhint-disable-next-line payable-fallback,no-complex-fallback
                    fallback() external {
                        bytes32 slot = FALLBACK_HANDLER_STORAGE_SLOT;
                        // solhint-disable-next-line no-inline-assembly
                        assembly {
                            let handler := sload(slot)
                            if iszero(handler) {
                                return(0, 0)
                            }
                            calldatacopy(0, 0, calldatasize())
                            // The msg.sender address is shifted to the left by 12 bytes to remove the padding
                            // Then the address without padding is stored right after the calldata
                            mstore(calldatasize(), shl(96, caller()))
                            // Add 20 bytes for the address appended add the end
                            let success := call(gas(), handler, 0, 0, add(calldatasize(), 20), 0, 0)
                            returndatacopy(0, 0, returndatasize())
                            if iszero(success) {
                                revert(0, returndatasize())
                            }
                            return(0, returndatasize())
                        }
                    }
                }
                // SPDX-License-Identifier: LGPL-3.0-only
                pragma solidity >=0.7.0 <0.9.0;
                import "../common/Enum.sol";
                import "../common/SelfAuthorized.sol";
                interface Guard {
                    function checkTransaction(
                        address to,
                        uint256 value,
                        bytes memory data,
                        Enum.Operation operation,
                        uint256 safeTxGas,
                        uint256 baseGas,
                        uint256 gasPrice,
                        address gasToken,
                        address payable refundReceiver,
                        bytes memory signatures,
                        address msgSender
                    ) external;
                    function checkAfterExecution(bytes32 txHash, bool success) external;
                }
                /// @title Fallback Manager - A contract that manages fallback calls made to this contract
                /// @author Richard Meissner - <[email protected]>
                contract GuardManager is SelfAuthorized {
                    event ChangedGuard(address guard);
                    // keccak256("guard_manager.guard.address")
                    bytes32 internal constant GUARD_STORAGE_SLOT = 0x4a204f620c8c5ccdca3fd54d003badd85ba500436a431f0cbda4f558c93c34c8;
                    /// @dev Set a guard that checks transactions before execution
                    /// @param guard The address of the guard to be used or the 0 address to disable the guard
                    function setGuard(address guard) external authorized {
                        bytes32 slot = GUARD_STORAGE_SLOT;
                        // solhint-disable-next-line no-inline-assembly
                        assembly {
                            sstore(slot, guard)
                        }
                        emit ChangedGuard(guard);
                    }
                    function getGuard() internal view returns (address guard) {
                        bytes32 slot = GUARD_STORAGE_SLOT;
                        // solhint-disable-next-line no-inline-assembly
                        assembly {
                            guard := sload(slot)
                        }
                    }
                }
                // SPDX-License-Identifier: LGPL-3.0-only
                pragma solidity >=0.7.0 <0.9.0;
                import "../common/Enum.sol";
                import "../common/SelfAuthorized.sol";
                import "./Executor.sol";
                /// @title Module Manager - A contract that manages modules that can execute transactions via this contract
                /// @author Stefan George - <[email protected]>
                /// @author Richard Meissner - <[email protected]>
                contract ModuleManager is SelfAuthorized, Executor {
                    event EnabledModule(address module);
                    event DisabledModule(address module);
                    event ExecutionFromModuleSuccess(address indexed module);
                    event ExecutionFromModuleFailure(address indexed module);
                    address internal constant SENTINEL_MODULES = address(0x1);
                    mapping(address => address) internal modules;
                    function setupModules(address to, bytes memory data) internal {
                        require(modules[SENTINEL_MODULES] == address(0), "GS100");
                        modules[SENTINEL_MODULES] = SENTINEL_MODULES;
                        if (to != address(0))
                            // Setup has to complete successfully or transaction fails.
                            require(execute(to, 0, data, Enum.Operation.DelegateCall, gasleft()), "GS000");
                    }
                    /// @dev Allows to add a module to the whitelist.
                    ///      This can only be done via a Safe transaction.
                    /// @notice Enables the module `module` for the Safe.
                    /// @param module Module to be whitelisted.
                    function enableModule(address module) public authorized {
                        // Module address cannot be null or sentinel.
                        require(module != address(0) && module != SENTINEL_MODULES, "GS101");
                        // Module cannot be added twice.
                        require(modules[module] == address(0), "GS102");
                        modules[module] = modules[SENTINEL_MODULES];
                        modules[SENTINEL_MODULES] = module;
                        emit EnabledModule(module);
                    }
                    /// @dev Allows to remove a module from the whitelist.
                    ///      This can only be done via a Safe transaction.
                    /// @notice Disables the module `module` for the Safe.
                    /// @param prevModule Module that pointed to the module to be removed in the linked list
                    /// @param module Module to be removed.
                    function disableModule(address prevModule, address module) public authorized {
                        // Validate module address and check that it corresponds to module index.
                        require(module != address(0) && module != SENTINEL_MODULES, "GS101");
                        require(modules[prevModule] == module, "GS103");
                        modules[prevModule] = modules[module];
                        modules[module] = address(0);
                        emit DisabledModule(module);
                    }
                    /// @dev Allows a Module to execute a Safe transaction without any further confirmations.
                    /// @param to Destination address of module transaction.
                    /// @param value Ether value of module transaction.
                    /// @param data Data payload of module transaction.
                    /// @param operation Operation type of module transaction.
                    function execTransactionFromModule(
                        address to,
                        uint256 value,
                        bytes memory data,
                        Enum.Operation operation
                    ) public virtual returns (bool success) {
                        // Only whitelisted modules are allowed.
                        require(msg.sender != SENTINEL_MODULES && modules[msg.sender] != address(0), "GS104");
                        // Execute transaction without further confirmations.
                        success = execute(to, value, data, operation, gasleft());
                        if (success) emit ExecutionFromModuleSuccess(msg.sender);
                        else emit ExecutionFromModuleFailure(msg.sender);
                    }
                    /// @dev Allows a Module to execute a Safe transaction without any further confirmations and return data
                    /// @param to Destination address of module transaction.
                    /// @param value Ether value of module transaction.
                    /// @param data Data payload of module transaction.
                    /// @param operation Operation type of module transaction.
                    function execTransactionFromModuleReturnData(
                        address to,
                        uint256 value,
                        bytes memory data,
                        Enum.Operation operation
                    ) public returns (bool success, bytes memory returnData) {
                        success = execTransactionFromModule(to, value, data, operation);
                        // solhint-disable-next-line no-inline-assembly
                        assembly {
                            // Load free memory location
                            let ptr := mload(0x40)
                            // We allocate memory for the return data by setting the free memory location to
                            // current free memory location + data size + 32 bytes for data size value
                            mstore(0x40, add(ptr, add(returndatasize(), 0x20)))
                            // Store the size
                            mstore(ptr, returndatasize())
                            // Store the data
                            returndatacopy(add(ptr, 0x20), 0, returndatasize())
                            // Point the return data to the correct memory location
                            returnData := ptr
                        }
                    }
                    /// @dev Returns if an module is enabled
                    /// @return True if the module is enabled
                    function isModuleEnabled(address module) public view returns (bool) {
                        return SENTINEL_MODULES != module && modules[module] != address(0);
                    }
                    /// @dev Returns array of modules.
                    /// @param start Start of the page.
                    /// @param pageSize Maximum number of modules that should be returned.
                    /// @return array Array of modules.
                    /// @return next Start of the next page.
                    function getModulesPaginated(address start, uint256 pageSize) external view returns (address[] memory array, address next) {
                        // Init array with max page size
                        array = new address[](pageSize);
                        // Populate return array
                        uint256 moduleCount = 0;
                        address currentModule = modules[start];
                        while (currentModule != address(0x0) && currentModule != SENTINEL_MODULES && moduleCount < pageSize) {
                            array[moduleCount] = currentModule;
                            currentModule = modules[currentModule];
                            moduleCount++;
                        }
                        next = currentModule;
                        // Set correct size of returned array
                        // solhint-disable-next-line no-inline-assembly
                        assembly {
                            mstore(array, moduleCount)
                        }
                    }
                }
                // SPDX-License-Identifier: LGPL-3.0-only
                pragma solidity >=0.7.0 <0.9.0;
                import "../common/SelfAuthorized.sol";
                /// @title OwnerManager - Manages a set of owners and a threshold to perform actions.
                /// @author Stefan George - <[email protected]>
                /// @author Richard Meissner - <[email protected]>
                contract OwnerManager is SelfAuthorized {
                    event AddedOwner(address owner);
                    event RemovedOwner(address owner);
                    event ChangedThreshold(uint256 threshold);
                    address internal constant SENTINEL_OWNERS = address(0x1);
                    mapping(address => address) internal owners;
                    uint256 internal ownerCount;
                    uint256 internal threshold;
                    /// @dev Setup function sets initial storage of contract.
                    /// @param _owners List of Safe owners.
                    /// @param _threshold Number of required confirmations for a Safe transaction.
                    function setupOwners(address[] memory _owners, uint256 _threshold) internal {
                        // Threshold can only be 0 at initialization.
                        // Check ensures that setup function can only be called once.
                        require(threshold == 0, "GS200");
                        // Validate that threshold is smaller than number of added owners.
                        require(_threshold <= _owners.length, "GS201");
                        // There has to be at least one Safe owner.
                        require(_threshold >= 1, "GS202");
                        // Initializing Safe owners.
                        address currentOwner = SENTINEL_OWNERS;
                        for (uint256 i = 0; i < _owners.length; i++) {
                            // Owner address cannot be null.
                            address owner = _owners[i];
                            require(owner != address(0) && owner != SENTINEL_OWNERS && owner != address(this) && currentOwner != owner, "GS203");
                            // No duplicate owners allowed.
                            require(owners[owner] == address(0), "GS204");
                            owners[currentOwner] = owner;
                            currentOwner = owner;
                        }
                        owners[currentOwner] = SENTINEL_OWNERS;
                        ownerCount = _owners.length;
                        threshold = _threshold;
                    }
                    /// @dev Allows to add a new owner to the Safe and update the threshold at the same time.
                    ///      This can only be done via a Safe transaction.
                    /// @notice Adds the owner `owner` to the Safe and updates the threshold to `_threshold`.
                    /// @param owner New owner address.
                    /// @param _threshold New threshold.
                    function addOwnerWithThreshold(address owner, uint256 _threshold) public authorized {
                        // Owner address cannot be null, the sentinel or the Safe itself.
                        require(owner != address(0) && owner != SENTINEL_OWNERS && owner != address(this), "GS203");
                        // No duplicate owners allowed.
                        require(owners[owner] == address(0), "GS204");
                        owners[owner] = owners[SENTINEL_OWNERS];
                        owners[SENTINEL_OWNERS] = owner;
                        ownerCount++;
                        emit AddedOwner(owner);
                        // Change threshold if threshold was changed.
                        if (threshold != _threshold) changeThreshold(_threshold);
                    }
                    /// @dev Allows to remove an owner from the Safe and update the threshold at the same time.
                    ///      This can only be done via a Safe transaction.
                    /// @notice Removes the owner `owner` from the Safe and updates the threshold to `_threshold`.
                    /// @param prevOwner Owner that pointed to the owner to be removed in the linked list
                    /// @param owner Owner address to be removed.
                    /// @param _threshold New threshold.
                    function removeOwner(
                        address prevOwner,
                        address owner,
                        uint256 _threshold
                    ) public authorized {
                        // Only allow to remove an owner, if threshold can still be reached.
                        require(ownerCount - 1 >= _threshold, "GS201");
                        // Validate owner address and check that it corresponds to owner index.
                        require(owner != address(0) && owner != SENTINEL_OWNERS, "GS203");
                        require(owners[prevOwner] == owner, "GS205");
                        owners[prevOwner] = owners[owner];
                        owners[owner] = address(0);
                        ownerCount--;
                        emit RemovedOwner(owner);
                        // Change threshold if threshold was changed.
                        if (threshold != _threshold) changeThreshold(_threshold);
                    }
                    /// @dev Allows to swap/replace an owner from the Safe with another address.
                    ///      This can only be done via a Safe transaction.
                    /// @notice Replaces the owner `oldOwner` in the Safe with `newOwner`.
                    /// @param prevOwner Owner that pointed to the owner to be replaced in the linked list
                    /// @param oldOwner Owner address to be replaced.
                    /// @param newOwner New owner address.
                    function swapOwner(
                        address prevOwner,
                        address oldOwner,
                        address newOwner
                    ) public authorized {
                        // Owner address cannot be null, the sentinel or the Safe itself.
                        require(newOwner != address(0) && newOwner != SENTINEL_OWNERS && newOwner != address(this), "GS203");
                        // No duplicate owners allowed.
                        require(owners[newOwner] == address(0), "GS204");
                        // Validate oldOwner address and check that it corresponds to owner index.
                        require(oldOwner != address(0) && oldOwner != SENTINEL_OWNERS, "GS203");
                        require(owners[prevOwner] == oldOwner, "GS205");
                        owners[newOwner] = owners[oldOwner];
                        owners[prevOwner] = newOwner;
                        owners[oldOwner] = address(0);
                        emit RemovedOwner(oldOwner);
                        emit AddedOwner(newOwner);
                    }
                    /// @dev Allows to update the number of required confirmations by Safe owners.
                    ///      This can only be done via a Safe transaction.
                    /// @notice Changes the threshold of the Safe to `_threshold`.
                    /// @param _threshold New threshold.
                    function changeThreshold(uint256 _threshold) public authorized {
                        // Validate that threshold is smaller than number of owners.
                        require(_threshold <= ownerCount, "GS201");
                        // There has to be at least one Safe owner.
                        require(_threshold >= 1, "GS202");
                        threshold = _threshold;
                        emit ChangedThreshold(threshold);
                    }
                    function getThreshold() public view returns (uint256) {
                        return threshold;
                    }
                    function isOwner(address owner) public view returns (bool) {
                        return owner != SENTINEL_OWNERS && owners[owner] != address(0);
                    }
                    /// @dev Returns array of owners.
                    /// @return Array of Safe owners.
                    function getOwners() public view returns (address[] memory) {
                        address[] memory array = new address[](ownerCount);
                        // populate return array
                        uint256 index = 0;
                        address currentOwner = owners[SENTINEL_OWNERS];
                        while (currentOwner != SENTINEL_OWNERS) {
                            array[index] = currentOwner;
                            currentOwner = owners[currentOwner];
                            index++;
                        }
                        return array;
                    }
                }
                // SPDX-License-Identifier: LGPL-3.0-only
                pragma solidity >=0.7.0 <0.9.0;
                /// @title Enum - Collection of enums
                /// @author Richard Meissner - <[email protected]>
                contract Enum {
                    enum Operation {Call, DelegateCall}
                }
                // SPDX-License-Identifier: LGPL-3.0-only
                pragma solidity >=0.7.0 <0.9.0;
                /// @title EtherPaymentFallback - A contract that has a fallback to accept ether payments
                /// @author Richard Meissner - <[email protected]>
                contract EtherPaymentFallback {
                    event SafeReceived(address indexed sender, uint256 value);
                    /// @dev Fallback function accepts Ether transactions.
                    receive() external payable {
                        emit SafeReceived(msg.sender, msg.value);
                    }
                }
                // SPDX-License-Identifier: LGPL-3.0-only
                pragma solidity >=0.7.0 <0.9.0;
                /// @title SecuredTokenTransfer - Secure token transfer
                /// @author Richard Meissner - <[email protected]>
                contract SecuredTokenTransfer {
                    /// @dev Transfers a token and returns if it was a success
                    /// @param token Token that should be transferred
                    /// @param receiver Receiver to whom the token should be transferred
                    /// @param amount The amount of tokens that should be transferred
                    function transferToken(
                        address token,
                        address receiver,
                        uint256 amount
                    ) internal returns (bool transferred) {
                        // 0xa9059cbb - keccack("transfer(address,uint256)")
                        bytes memory data = abi.encodeWithSelector(0xa9059cbb, receiver, amount);
                        // solhint-disable-next-line no-inline-assembly
                        assembly {
                            // We write the return value to scratch space.
                            // See https://docs.soliditylang.org/en/v0.7.6/internals/layout_in_memory.html#layout-in-memory
                            let success := call(sub(gas(), 10000), token, 0, add(data, 0x20), mload(data), 0, 0x20)
                            switch returndatasize()
                                case 0 {
                                    transferred := success
                                }
                                case 0x20 {
                                    transferred := iszero(or(iszero(success), iszero(mload(0))))
                                }
                                default {
                                    transferred := 0
                                }
                        }
                    }
                }
                // SPDX-License-Identifier: LGPL-3.0-only
                pragma solidity >=0.7.0 <0.9.0;
                /// @title SelfAuthorized - authorizes current contract to perform actions
                /// @author Richard Meissner - <[email protected]>
                contract SelfAuthorized {
                    function requireSelfCall() private view {
                        require(msg.sender == address(this), "GS031");
                    }
                    modifier authorized() {
                        // This is a function call as it minimized the bytecode size
                        requireSelfCall();
                        _;
                    }
                }
                // SPDX-License-Identifier: LGPL-3.0-only
                pragma solidity >=0.7.0 <0.9.0;
                /// @title SignatureDecoder - Decodes signatures that a encoded as bytes
                /// @author Richard Meissner - <[email protected]>
                contract SignatureDecoder {
                    /// @dev divides bytes signature into `uint8 v, bytes32 r, bytes32 s`.
                    /// @notice Make sure to peform a bounds check for @param pos, to avoid out of bounds access on @param signatures
                    /// @param pos which signature to read. A prior bounds check of this parameter should be performed, to avoid out of bounds access
                    /// @param signatures concatenated rsv signatures
                    function signatureSplit(bytes memory signatures, uint256 pos)
                        internal
                        pure
                        returns (
                            uint8 v,
                            bytes32 r,
                            bytes32 s
                        )
                    {
                        // The signature format is a compact form of:
                        //   {bytes32 r}{bytes32 s}{uint8 v}
                        // Compact means, uint8 is not padded to 32 bytes.
                        // solhint-disable-next-line no-inline-assembly
                        assembly {
                            let signaturePos := mul(0x41, pos)
                            r := mload(add(signatures, add(signaturePos, 0x20)))
                            s := mload(add(signatures, add(signaturePos, 0x40)))
                            // Here we are loading the last 32 bytes, including 31 bytes
                            // of 's'. There is no 'mload8' to do this.
                            //
                            // 'byte' is not working due to the Solidity parser, so lets
                            // use the second best option, 'and'
                            v := and(mload(add(signatures, add(signaturePos, 0x41))), 0xff)
                        }
                    }
                }
                // SPDX-License-Identifier: LGPL-3.0-only
                pragma solidity >=0.7.0 <0.9.0;
                /// @title Singleton - Base for singleton contracts (should always be first super contract)
                ///         This contract is tightly coupled to our proxy contract (see `proxies/GnosisSafeProxy.sol`)
                /// @author Richard Meissner - <[email protected]>
                contract Singleton {
                    // singleton always needs to be first declared variable, to ensure that it is at the same location as in the Proxy contract.
                    // It should also always be ensured that the address is stored alone (uses a full word)
                    address private singleton;
                }
                // SPDX-License-Identifier: LGPL-3.0-only
                pragma solidity >=0.7.0 <0.9.0;
                /// @title StorageAccessible - generic base contract that allows callers to access all internal storage.
                /// @notice See https://github.com/gnosis/util-contracts/blob/bb5fe5fb5df6d8400998094fb1b32a178a47c3a1/contracts/StorageAccessible.sol
                contract StorageAccessible {
                    /**
                     * @dev Reads `length` bytes of storage in the currents contract
                     * @param offset - the offset in the current contract's storage in words to start reading from
                     * @param length - the number of words (32 bytes) of data to read
                     * @return the bytes that were read.
                     */
                    function getStorageAt(uint256 offset, uint256 length) public view returns (bytes memory) {
                        bytes memory result = new bytes(length * 32);
                        for (uint256 index = 0; index < length; index++) {
                            // solhint-disable-next-line no-inline-assembly
                            assembly {
                                let word := sload(add(offset, index))
                                mstore(add(add(result, 0x20), mul(index, 0x20)), word)
                            }
                        }
                        return result;
                    }
                    /**
                     * @dev Performs a delegetecall on a targetContract in the context of self.
                     * Internally reverts execution to avoid side effects (making it static).
                     *
                     * This method reverts with data equal to `abi.encode(bool(success), bytes(response))`.
                     * Specifically, the `returndata` after a call to this method will be:
                     * `success:bool || response.length:uint256 || response:bytes`.
                     *
                     * @param targetContract Address of the contract containing the code to execute.
                     * @param calldataPayload Calldata that should be sent to the target contract (encoded method name and arguments).
                     */
                    function simulateAndRevert(address targetContract, bytes memory calldataPayload) external {
                        // solhint-disable-next-line no-inline-assembly
                        assembly {
                            let success := delegatecall(gas(), targetContract, add(calldataPayload, 0x20), mload(calldataPayload), 0, 0)
                            mstore(0x00, success)
                            mstore(0x20, returndatasize())
                            returndatacopy(0x40, 0, returndatasize())
                            revert(0, add(returndatasize(), 0x40))
                        }
                    }
                }
                // SPDX-License-Identifier: LGPL-3.0-only
                pragma solidity >=0.7.0 <0.9.0;
                /**
                 * @title GnosisSafeMath
                 * @dev Math operations with safety checks that revert on error
                 * Renamed from SafeMath to GnosisSafeMath to avoid conflicts
                 * TODO: remove once open zeppelin update to solc 0.5.0
                 */
                library GnosisSafeMath {
                    /**
                     * @dev Multiplies two numbers, reverts on overflow.
                     */
                    function mul(uint256 a, uint256 b) internal pure returns (uint256) {
                        // Gas optimization: this is cheaper than requiring 'a' not being zero, but the
                        // benefit is lost if 'b' is also tested.
                        // See: https://github.com/OpenZeppelin/openzeppelin-solidity/pull/522
                        if (a == 0) {
                            return 0;
                        }
                        uint256 c = a * b;
                        require(c / a == b);
                        return c;
                    }
                    /**
                     * @dev Subtracts two numbers, reverts on overflow (i.e. if subtrahend is greater than minuend).
                     */
                    function sub(uint256 a, uint256 b) internal pure returns (uint256) {
                        require(b <= a);
                        uint256 c = a - b;
                        return c;
                    }
                    /**
                     * @dev Adds two numbers, reverts on overflow.
                     */
                    function add(uint256 a, uint256 b) internal pure returns (uint256) {
                        uint256 c = a + b;
                        require(c >= a);
                        return c;
                    }
                    /**
                     * @dev Returns the largest of two numbers.
                     */
                    function max(uint256 a, uint256 b) internal pure returns (uint256) {
                        return a >= b ? a : b;
                    }
                }
                // SPDX-License-Identifier: LGPL-3.0-only
                pragma solidity >=0.7.0 <0.9.0;
                contract ISignatureValidatorConstants {
                    // bytes4(keccak256("isValidSignature(bytes,bytes)")
                    bytes4 internal constant EIP1271_MAGIC_VALUE = 0x20c13b0b;
                }
                abstract contract ISignatureValidator is ISignatureValidatorConstants {
                    /**
                     * @dev Should return whether the signature provided is valid for the provided data
                     * @param _data Arbitrary length data signed on the behalf of address(this)
                     * @param _signature Signature byte array associated with _data
                     *
                     * MUST return the bytes4 magic value 0x20c13b0b when function passes.
                     * MUST NOT modify state (using STATICCALL for solc < 0.5, view modifier for solc > 0.5)
                     * MUST allow external calls
                     */
                    function isValidSignature(bytes memory _data, bytes memory _signature) public view virtual returns (bytes4);
                }