diff --git a/contracts/Burner.cdc b/contracts/Burner.cdc new file mode 100644 index 000000000..5e2c881a7 --- /dev/null +++ b/contracts/Burner.cdc @@ -0,0 +1,79 @@ +// Burner is a contract that can facilitate the destruction of any resource on flow. +// +// Contributors +// - Austin Kline - https://twitter.com/austin_flowty +// - Deniz Edincik - https://twitter.com/bluesign +// - Bastian Müller - https://twitter.com/turbolent +pub contract Burner { + // When Crescendo (Cadence 1.0) is released, custom destructors will be removed from cadece. + // Burnable is an interface meant to replace this lost feature, allowing anyone to add a callback + // method to ensure they do not destroy something which is not meant to be, or to add logic based on destruction + // such as tracking the supply of an NFT Collection + // + // NOTE: The only way to see benefit from this interface is to call the burnCallback method yourself, + // or to always use the burn method in this contract. Anyone who owns a resource can always elect **not** + // to destroy a resource this way + pub resource interface Burnable { + pub fun burnCallback() + } + + // burn is a global method which will destroy any resource it is given. + // If the provided resource implements the Burnable interface, it will call the burnCallback + // method and then destroy afterwards. + pub fun burn(_ r: @AnyResource) { + if let s <- r as? @{Burnable} { + s.burnCallback() + destroy s + } else if let arr <- r as? @[AnyResource] { + while arr.length > 0 { + let item <- arr.removeFirst() + self.burn(<-item) + } + destroy arr + } else if let stringDict <- r as? @{String: AnyResource} { + let keys = stringDict.keys + while keys.length > 0 { + let item <- stringDict.remove(key: keys.removeFirst())! + self.burn(<-item) + } + destroy stringDict + } else if let numDict <- r as? @{Number: AnyResource} { + let keys = numDict.keys + while keys.length > 0 { + let item <- numDict.remove(key: keys.removeFirst())! + self.burn(<-item) + } + destroy numDict + } else if let typeDict <- r as? @{Type: AnyResource} { + let keys = typeDict.keys + while keys.length > 0 { + let item <- typeDict.remove(key: keys.removeFirst())! + self.burn(<-item) + } + destroy typeDict + } else if let addressDict <- r as? @{Address: AnyResource} { + let keys = addressDict.keys + while keys.length > 0 { + let item <- addressDict.remove(key: keys.removeFirst())! + self.burn(<-item) + } + destroy addressDict + } else if let pathDict <- r as? @{Path: AnyResource} { + let keys = pathDict.keys + while keys.length > 0 { + let item <- pathDict.remove(key: keys.removeFirst())! + self.burn(<-item) + } + destroy pathDict + } else if let charDict <- r as? @{Character: AnyResource} { + let keys = charDict.keys + while keys.length > 0 { + let item <- charDict.remove(key: keys.removeFirst())! + self.burn(<-item) + } + destroy charDict + } else { + destroy r + } + } +} \ No newline at end of file diff --git a/contracts/testContracts/BurnableTest.cdc b/contracts/testContracts/BurnableTest.cdc new file mode 100644 index 000000000..872b0098d --- /dev/null +++ b/contracts/testContracts/BurnableTest.cdc @@ -0,0 +1,32 @@ +import "Burner" + +pub contract BurnableTest { + pub var totalBurned: UInt64 + + pub resource WithCallback: Burner.Burnable { + pub let allowDestroy: Bool + + pub fun burnCallback() { + assert(self.allowDestroy, message: "allowDestroy must be set to true") + BurnableTest.totalBurned = BurnableTest.totalBurned + 1 + } + + init(_ allowDestroy: Bool) { + self.allowDestroy = allowDestroy + } + } + + pub resource WithoutCallback {} + + pub fun createSafe(allowDestroy: Bool): @WithCallback { + return <- create WithCallback(allowDestroy) + } + + pub fun createUnsafe(): @WithoutCallback { + return <- create WithoutCallback() + } + + init() { + self.totalBurned = 0 + } +} \ No newline at end of file diff --git a/flow.json b/flow.json index e5a5fc3d7..164bd62f9 100644 --- a/flow.json +++ b/flow.json @@ -89,6 +89,18 @@ "aliases": { "testing": "0x0000000000000007" } + }, + "Burner": { + "source": "./contracts/Burner.cdc", + "aliases": { + "testing": "0x0000000000000007" + } + }, + "BurnableTest": { + "source": "./contracts/testContracts/BurnableTest.cdc", + "aliases": { + "testing": "0x0000000000000007" + } } }, "networks": { diff --git a/lib/go/contracts/internal/assets/assets.go b/lib/go/contracts/internal/assets/assets.go index 72944a9ba..b04a2fc67 100644 --- a/lib/go/contracts/internal/assets/assets.go +++ b/lib/go/contracts/internal/assets/assets.go @@ -1,5 +1,6 @@ // Code generated by go-bindata. DO NOT EDIT. // sources: +// Burner.cdc (3.324kB) // FlowContractAudits.cdc (9.042kB) // FlowFees.cdc (9.381kB) // FlowIDTableStaking.cdc (98.127kB) @@ -14,6 +15,7 @@ // epochs/FlowClusterQC.cdc (17.938kB) // epochs/FlowDKG.cdc (18.385kB) // epochs/FlowEpoch.cdc (46.694kB) +// testContracts/BurnableTest.cdc (759B) // testContracts/TestFlowIDTableStaking.cdc (8.518kB) package assets @@ -84,6 +86,26 @@ func (fi bindataFileInfo) Sys() interface{} { return nil } +var _burnerCdc = "\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\xbc\x96\xc1\x6e\xe3\x36\x10\x86\xef\x7e\x8a\xe9\x2d\x09\x12\x6b\x7b\x35\xb6\xed\x66\xbd\xbb\x40\x51\x34\x2d\xda\x00\x3d\x14\xc5\x82\xa2\x46\x16\x61\x6a\x28\x90\xc3\x08\x6a\xe0\x37\xeb\xad\x2f\xb6\x18\xc9\x94\x15\xc1\x06\x7c\x30\xac\x9b\xc9\x99\xff\x9f\xf9\x38\x94\x95\x65\xf0\x31\x7a\x42\x0f\x26\x80\x02\xed\x88\xbd\xd2\x0c\x5c\x29\x06\xad\x08\x4a\xa5\x8d\x35\xac\x18\x81\x2b\x84\x02\x03\xfb\xa8\xd9\x38\x02\x57\x82\xa2\x0e\x3c\x06\x17\xbd\x46\x70\x04\xa5\x75\xed\x72\x91\x65\x8b\x2c\x83\xb5\x68\x99\x3c\xb2\xf3\x41\x7e\x3f\xc0\x63\x0c\x6c\x08\x7e\xb1\x86\x10\x1e\xa0\x62\x6e\xc2\x2a\xcb\xb8\x35\xcc\xe8\x97\xda\xd5\x99\xea\x43\xbe\x8a\x0e\x77\x43\xd6\x27\x24\xf3\x2f\x7c\x2e\x0c\x69\xb3\x3d\x91\x96\xdb\x88\xc1\x6c\x68\xc8\xf8\xa8\x02\x1b\x45\xf0\xeb\xff\xff\x59\x8b\xfe\x44\x0e\x47\x9f\x3b\x8b\xc4\x8b\x26\xe6\x87\xce\xf7\x38\x5e\x17\x00\x00\x59\x06\x7f\x55\x48\xb0\xf6\x18\x34\x52\xe1\xe0\x66\xad\x0a\x24\x8d\xf0\xfd\xf2\xdd\xad\x40\xf3\x68\x51\x05\x2c\xee\x41\xc7\xc0\xae\x1e\x11\x39\x1f\xa0\x35\xd6\x42\x8e\xe0\xb1\x76\x2f\x58\x40\xe9\x5d\x0d\x5a\x15\xa8\x71\x99\x0c\xc4\x50\xe5\x16\xfb\x13\x20\x30\xc4\xe8\x4b\xa5\x11\x6a\x54\xc4\xc0\x0e\x3c\x36\x56\x16\xb8\x32\x01\xac\x0b\x0c\x25\x2a\x8e\x1e\xef\x41\x59\xeb\x5a\x43\x1b\x39\x09\x47\x28\xd1\xaa\x28\xe4\x24\x95\xb5\xb9\xd2\xdb\xe4\x52\x23\x57\xae\x90\x7d\xa4\x10\x7d\x7f\x9a\x1d\x14\x0e\xc8\xf1\x50\xb2\xeb\x20\x38\x09\x13\xb9\xb6\x32\xba\x92\x8a\x64\x7b\x2c\x24\xc7\x7b\x70\x3e\x99\x58\xb7\x31\x1a\x72\x69\x5e\xce\x7e\x32\x1a\xc9\x34\x44\x5d\x81\x0a\x20\x64\xb7\x22\x2b\x23\x14\x62\xd3\xd8\x6e\x98\x1e\x78\xfa\xf2\x0c\x6b\x67\x2d\x4e\xf3\x52\xfa\xd3\x6f\xcf\x9f\x57\xf0\x5c\xc9\x68\xd9\x0e\x5a\xd5\x89\x75\x40\x84\x1c\x09\x4b\xc3\x03\xcf\x1e\xcb\x01\x9b\x09\x12\x25\xfd\xf7\x76\x79\xf4\xb4\xde\xc3\x48\x14\x3a\x17\x7d\x40\x5b\xde\x27\xa7\x7d\x53\xb6\x55\x5d\x80\x18\x70\xcc\x4c\x19\x86\x06\x9b\x34\x26\x4b\x78\x1c\x80\xb7\x95\x03\xd7\x92\x5c\x9e\xf1\x22\xc8\xbd\xd9\x6b\xa1\x74\x06\x77\x77\xe4\xf8\xee\x2e\xb9\xb1\x1b\x89\x4f\xb2\x7a\xfd\x56\x75\x7d\x94\x8c\xe4\xb8\x73\xe8\x6d\x9c\x95\x61\x3c\x53\x64\x19\xe9\x4d\x9f\x37\xb7\xfd\xf6\x6e\x91\x1c\xfb\x56\xfa\x1b\xbe\xb1\x2e\x57\x36\xb5\x35\x1c\x73\x3f\xa5\x63\x45\xd3\x2b\x6d\x58\xb2\x36\xe6\x05\x69\x9c\xd7\x9f\xcb\x9e\x4e\xe3\xdd\x8b\x29\xb0\x98\x04\xd7\x8d\xc5\x1a\x89\x43\x1f\x70\x98\xeb\x54\xfe\xbd\xe8\xf5\x66\x47\x4f\x67\x36\xaa\x8a\x0a\x09\xa1\x43\x65\x25\xa3\x6f\x95\x2f\xc2\x72\x31\xef\xfc\xe6\x2b\xf8\x15\x7c\x78\xa4\xee\x8f\x7d\x39\xb7\x13\x46\xa6\x04\x8b\x0c\x01\xde\x3f\x80\x07\x15\x7e\x82\x0f\xaf\xa9\xbc\xdd\x24\x4e\x9e\xb0\x3c\x42\x32\x3d\xe3\x45\x19\x57\x77\x80\x36\x60\x72\x50\xde\x4f\x3c\xfe\x9e\x94\xf3\xcf\xcc\xa6\xad\x8c\x45\x89\x5f\x5a\xa4\x0d\x57\xf0\x23\xbc\x9b\x85\xc8\x23\xa2\x86\xb1\x16\x55\x09\x1e\x5e\x24\x5f\x8c\x0f\x3c\x2b\xad\xaf\x1d\x6d\xd9\x97\x7f\xf3\xfe\x41\xb2\xde\x46\xec\x8e\xb6\xa2\xbc\x3f\xd1\x4c\x60\x6f\x68\xf3\xc9\x68\x9e\x72\xfb\xb3\x5f\x5d\xc1\xa4\xb7\x39\x42\x49\xde\x62\x17\xe0\x87\x89\xc6\x52\x56\x8e\x20\x90\xe5\xf3\x19\x4c\xf4\x06\x14\x37\x5b\xec\x56\x83\xc8\x1b\x36\xb7\xdf\x5d\x84\xce\xc1\xef\x04\x24\x8a\xf5\x9c\xd0\x53\xac\x73\xf4\xe7\x12\xda\x0b\x5c\x06\x4f\x12\xbb\x0a\x9b\xbd\xd9\x09\x30\xdc\x35\x38\x27\xf3\xdc\x35\x78\x2e\x97\x94\x7f\x19\x30\xa3\xda\x55\xc8\x24\xb7\x53\x6f\x89\xa2\xf0\x18\xc2\x9c\xce\xe3\xb0\x7c\x2e\xa0\x89\xca\x65\x18\x4d\x05\xaf\x82\x69\x62\x78\x82\x54\xa3\xb8\x9a\x63\xfa\x5d\x71\x75\x2e\xa3\x94\x7f\x19\x40\xa3\xda\x55\xe8\x24\xb7\x13\x68\x74\xa5\xfc\x1c\xcd\xba\x52\xf2\x71\x72\xfe\xcb\x27\x89\x5c\x86\xcf\xa8\x76\x15\x3e\xc9\x6d\xce\xe7\xf5\x68\xf4\xe4\x4f\x6e\xff\x6d\xb4\xfb\x16\x00\x00\xff\xff\x4a\x1b\x90\xa3\xfc\x0c\x00\x00" + +func burnerCdcBytes() ([]byte, error) { + return bindataRead( + _burnerCdc, + "Burner.cdc", + ) +} + +func burnerCdc() (*asset, error) { + bytes, err := burnerCdcBytes() + if err != nil { + return nil, err + } + + info := bindataFileInfo{name: "Burner.cdc", size: 0, mode: os.FileMode(0), modTime: time.Unix(0, 0)} + a := &asset{bytes: bytes, info: info, digest: [32]uint8{0x75, 0x58, 0x9f, 0xc6, 0xf9, 0x90, 0x27, 0x89, 0xa, 0x8b, 0x5f, 0xe4, 0x11, 0x53, 0x95, 0x1a, 0x99, 0xba, 0x2c, 0xe3, 0x69, 0x60, 0x63, 0xc9, 0xc0, 0xd2, 0x40, 0x8, 0x4d, 0xd4, 0xfe, 0x58}} + return a, nil +} + var _flowcontractauditsCdc = "\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\xbc\x59\x6d\x6f\xe3\xb8\x11\xfe\x9e\x5f\x31\xde\x02\x3d\x1b\x75\xac\x62\xdb\x1e\x0a\x63\x7d\xd7\x5c\xee\xb6\xbb\x2d\xda\x2e\x2e\x77\xf7\xa5\x28\x16\xb4\x34\xb2\x08\xcb\xa4\x41\x52\xf6\x1a\x41\xfe\x7b\xc1\x37\x89\x94\x28\xc7\x9b\x64\x37\x1f\x02\x5b\x26\x67\x1e\xce\xcb\xc3\x99\x51\x96\x65\xf0\x4b\x45\x25\xe4\x9c\x29\x41\x72\x05\x47\x22\xa1\x91\x58\x80\xe2\xb0\x23\x8c\x6c\x10\x48\x53\x50\x25\x81\xb0\x02\xc8\x7e\x2f\xf8\x81\xd4\xf2\x4a\xef\x2c\xb9\x80\x02\xf7\x35\x3f\xed\x90\x29\xbd\xe3\x6d\xcd\x8f\xb0\x23\x94\x31\x54\xb0\xc6\x92\x0b\x84\x3d\x8a\x1d\x95\x92\x72\x56\xa3\x94\xc1\x06\x23\x43\xeb\x43\x46\xd6\x35\x16\x40\x19\xfc\xa3\x61\x08\xaf\xff\xf8\xfa\xf5\x02\xde\x2b\xa0\x12\x18\x87\x9a\xb3\x0d\x0a\x83\x6a\x0e\xeb\xc6\x3c\x96\x8a\xd6\xb5\x11\x60\xe5\x59\xc0\xaa\x42\xb8\x43\x71\xa0\x39\xc2\x4d\x9e\xf3\x86\xa9\x39\x48\x0e\xd4\xec\x29\x78\xde\x68\xbd\x58\x40\x85\x02\xdb\x23\x08\x2c\x51\x20\xcb\xf1\xea\x6a\xdf\xac\x3b\x53\xe8\xc3\xdc\xba\x2f\x37\xd6\x06\xf7\x57\x00\x00\xe6\x5f\x96\xc1\x4f\x07\x73\xec\x8a\x18\xf1\xb8\xa3\x4a\xcb\x3e\x56\xc8\x80\x00\xc3\x23\x98\x5d\x46\x83\xe4\x8d\xc8\x51\x2f\xcb\x05\x12\x85\x85\x91\xa1\xd5\xa1\x11\xe2\x56\xde\xda\x1f\xa7\xb3\xab\x8b\x75\xb4\x70\x8d\x9b\xe0\xc0\x9b\xbc\x42\x31\xae\xe9\x37\xbb\xc0\x6b\x22\x45\x21\x50\xca\x25\xdc\xd8\x0f\xdf\xcf\x41\x60\xde\x08\x81\x4c\x2d\xe1\x07\xce\xeb\x39\xe0\xa7\x3d\x15\xa7\x1f\x6a\x9e\x6f\xdf\x21\xdd\x54\x6a\x09\xbf\xbe\x67\xea\xdb\x3f\x7f\x3f\x87\x9c\x17\xf8\x8e\xc8\x6a\x09\x77\x4a\x50\xb6\xb9\x10\xf9\x38\x6a\xed\xe6\x34\xe4\x5f\x65\x02\xef\x1c\xb6\x78\xf2\xca\x3f\x0b\xfb\xb3\x91\x0a\xdc\xf1\xc3\x18\xd8\x9f\xed\x8f\xd3\xe7\xa3\xfb\x91\xe6\x8a\x72\x46\xc4\x09\x78\x09\xa4\xae\x3d\x06\x69\x56\x90\x3c\x47\x29\xa7\x1e\xe6\x0c\x0e\x44\xb4\x2b\x96\x70\x6f\x75\x2f\x6d\x84\x39\x70\x0f\xad\xf0\x5f\x2a\x04\xa9\xb8\xd0\x79\xbe\x27\xaa\x32\x09\xa1\xd3\x88\x14\x3b\xca\xda\xc0\x6d\xcf\x58\xa3\x82\x1b\xfd\xd3\x9d\xdd\xf4\x81\x28\xe3\xfa\xf6\x4b\x52\xf2\x07\x2f\x99\xd8\x30\x97\xdf\xf8\x80\xff\x20\xf8\xa7\x53\x2c\x3d\xf8\xe1\x22\x25\xfb\x66\x5d\xd3\xbc\x43\x9f\xd6\x01\x39\xd9\x93\x35\xad\xa9\x1a\x57\xf7\xc1\x48\xb2\xda\xba\xcf\xad\xb2\x3b\xca\x36\x35\xf6\xe2\xc0\x47\x8d\xe1\x4c\xad\xbe\x8d\x97\x80\xe8\xbc\x42\xa9\x44\x93\xab\xc8\x15\x8e\x52\x5a\x5a\x71\xba\x5c\x74\x6b\x8f\x1b\x6f\x58\x32\x33\x9f\x83\x08\xa4\x4c\x21\x2b\xac\xe2\x70\xf7\xfb\x12\x18\xad\xe7\x66\x79\x8b\x27\x27\x0c\xd6\x18\xf1\x25\x61\x27\x2f\xba\xdd\xee\x0d\x33\x20\x86\xab\x9e\x86\x92\xd4\x12\xe7\x11\xa4\x23\xad\x6b\xad\xc3\x65\x06\x90\x52\xa1\x80\x92\x0a\xa9\xb4\x81\x06\x3a\x7a\xf9\xd0\xd7\xc0\x38\xbb\x6e\xcf\xd1\xea\xe0\xec\x1b\x7d\xb7\xc0\x81\xd4\xd4\xab\xd0\x0b\x6c\x2e\xc1\x5a\x27\x13\x54\x26\x9b\x06\x0a\xc7\xf3\x2d\xe9\x05\x4d\x6c\xda\x05\x9d\x0d\x79\x31\x3c\x45\x9f\x02\x87\xa2\x28\xa3\xea\xe5\x99\x36\x08\x1d\xfd\x27\xb1\x2e\x17\x4e\x09\xac\xbc\xff\x86\x4b\x5a\xa5\xb0\xea\x00\x0c\x97\x0d\xa0\xc0\x6a\x08\x6f\xb8\xcd\xa3\x84\x55\x0b\xb8\x5d\xf4\x70\x65\xff\xfb\x84\xfa\x19\x55\x23\x98\x34\x9c\xe6\x31\x45\xdc\xa6\x2d\x5c\x36\x0c\x36\xa8\x6e\xea\xda\x65\x8c\x9c\xce\xc6\x68\x2d\xb0\x88\x30\xb2\x2d\xa6\x48\x66\xa7\xfe\xef\x68\x13\x8a\x48\xc9\x73\xaa\x6f\x43\x28\x3a\xae\xdd\xe2\xc9\xe4\xf3\x86\x1e\xf4\x3d\xe0\xec\xaa\x8b\xa0\xe8\x5c\x1d\x44\x86\x82\x28\x74\x50\xfe\x89\xa7\x94\xc3\x07\x3e\xf4\x1f\x02\xe4\xb4\x6c\xb5\x4d\x56\x3a\x8f\x7b\x7e\x76\x27\x73\x6b\x26\x0b\xc5\xad\x88\xe9\x6c\x91\x73\x96\x13\x35\x7d\x75\xfd\xaa\xfd\xec\x35\xce\x7a\x5e\x08\x24\xbd\x22\xec\x74\xfd\x2a\xbd\xe1\xa1\x2b\x78\xfc\x49\x2b\x22\x2b\x5f\x16\xdd\xf2\x02\xa7\x1f\xcd\xb1\xce\x1d\xc9\x29\xb2\xcf\x17\xc8\x8c\x0e\xfc\x34\xd5\x7a\x6e\xea\x0d\x17\x54\x55\xbb\xc5\xdd\xbb\x9b\x3f\x7d\x7c\xfd\x97\x6f\x17\x5a\x83\xc1\xb1\x68\x54\xf9\xd7\xd9\xac\xe7\x37\x47\xd9\xd2\x30\x9a\x2d\x72\x4c\x25\xe4\xdd\x6c\x9c\x64\x29\x48\xfb\x77\xd7\xa2\x6f\xcb\x30\x5f\x97\xdd\x47\x8c\x73\x3b\x10\x05\x47\xaa\xaa\x33\xd9\xaf\xcd\x41\x8a\xc2\xf9\xfc\x33\x32\xfc\x3f\x65\x29\xb1\x9f\xdc\x63\x89\x1d\x72\x0c\xac\x12\x65\xe9\x62\xe0\x12\xbd\x7c\x96\x64\x07\x87\x55\xcb\x0a\xab\x29\xe2\xab\xa9\x00\x70\xfb\xb1\x8f\x3a\xfc\x16\xc6\x74\x2a\xd6\x2e\x31\x70\x65\xc0\x5c\x6c\xe7\x3e\xf6\xa7\x59\xbb\x4f\xa5\x91\xb5\xb2\x0c\x72\x52\xe7\x4d\xad\xf1\x26\x2e\x16\x58\x13\x7d\xdf\x73\x16\x69\x88\x44\xe8\x32\x6c\x9c\xce\xc1\x64\x76\xb4\x81\x96\x91\xb0\x74\xf2\xeb\xbf\x14\x33\x6f\x50\xdd\xda\xa3\x9b\xe7\xd3\xd9\xc2\x01\xfd\x43\x24\x74\x12\x09\x7b\x88\xbe\x0d\x62\x4e\x33\x60\x32\xdc\xce\x71\x5d\x1b\x48\xa9\xb0\xe8\xdb\x58\x53\x5d\x1c\x0a\x9a\x8f\x25\xd9\xa1\x51\x8e\x9f\xa8\x54\x26\x26\x4d\x2e\x53\x65\x4b\x89\x48\x4a\x02\x5e\x81\x35\xb6\xe0\x74\x01\xde\x53\xac\xcf\xe6\x95\xae\xa2\x0b\xe4\x33\xf3\x21\x72\xec\xe0\x51\xd2\x04\x91\xc1\x1f\x3b\x88\x27\xb4\x05\x65\x12\x85\xb2\xbd\xc4\x16\x4f\x73\x0f\xff\x8c\x38\xdd\xc5\x8c\xf6\x7a\x5f\xea\x74\x23\x79\x6f\x7b\xa1\xbe\xab\xed\xc5\xba\xc5\xd3\x20\xd5\x07\x0e\x1c\x63\xc6\x8b\x9c\x9f\x8c\xf1\x7e\x29\xa2\x7b\x4b\x58\x9f\x5c\xdb\xa3\x38\x48\x57\x1c\xf8\xab\x22\xd1\x3e\x74\x5d\x3d\x53\x28\x4a\xd2\x5d\x2c\x41\x37\x11\x20\xf6\xc7\x93\xa8\x7c\xbb\xdf\x0a\xd5\x97\x28\xd9\x2f\xa1\x7b\xf2\xe6\xf7\x6e\xd1\x77\xfd\xfb\x4f\x37\x3d\xae\xc9\x69\x1b\x03\x53\x79\x57\xe4\xe0\xdb\x13\xdb\x15\x82\xaa\x04\x6f\x36\xd5\xb0\xdb\xf2\x73\x1f\x3b\x7a\x91\x41\xcb\xd7\xb6\x1a\x1c\x04\x1e\xf8\x16\x9d\xac\xb6\x0b\x42\x84\x4a\xa9\xbd\x5c\x66\x59\xc1\x73\xb9\xe0\xac\xac\xf9\x71\xc1\xc5\x26\xcb\x49\x81\x2c\xc7\xac\x40\x49\x37\xec\x7a\x4f\x94\x42\xc1\x64\xf6\xbb\xce\x7a\xd7\x5a\x68\x4e\x74\x95\x35\x7a\x2f\x1b\x98\xcb\xf3\xc6\x74\x6d\xaf\xbe\xd6\x6c\xcb\x4b\xfa\x26\x4d\x1b\x33\x68\x63\x9e\xec\x8f\x64\xe1\xdd\x97\xa0\x0b\x60\xb2\x4f\x65\xc4\xd7\xab\x1c\xd2\xc8\x26\x8b\x35\x17\x82\x1f\xa7\xb3\xc9\x22\x85\xe1\x99\xb5\x80\xe5\x83\x24\x17\x7c\xad\xbb\xfc\xa9\x36\xf8\xfa\x55\xd1\x67\x53\xde\xe3\xc7\x49\x88\x32\x77\x60\x42\xbb\xe9\x4b\x2f\x0e\xe7\xb0\x60\x71\x42\x3a\x52\xba\xb5\xd3\x85\x9c\xd4\xb5\x63\x52\x76\xe2\x0c\xcd\xbc\x96\x21\x16\x12\x48\xc0\xa1\x9a\x5d\xca\x86\xe5\x11\x0d\x68\x3b\xd8\x72\x3e\xcc\x7c\xdd\xed\xfd\x2d\x9a\xe4\x0c\xfa\x8a\x37\xd7\xbe\x0d\x88\x37\x86\x10\x63\x9e\xd1\x4c\x47\xa5\x12\xc4\x76\x01\x5e\xde\xb0\x58\x95\xe1\x1c\x77\xe0\x35\xab\xf5\xdf\x78\x74\x0b\x42\xac\x3d\xab\x9a\xfb\x78\x30\xe5\x0d\x57\xb4\x87\x89\xcf\x32\x1d\xad\xa6\x2b\xcc\xb7\x32\x1a\x08\x06\x9d\x8f\xb4\xf1\x68\x8a\x54\x94\x43\xe4\x35\x12\xd6\xec\x7f\xb2\x6b\xba\xce\xba\x87\x5a\x37\xc0\xba\x12\xa3\xec\x6c\x7d\xb2\xc5\x93\x84\x7b\xe8\xfd\x0d\x0a\x57\x53\x78\xa5\x4b\x4a\x2f\xea\xbf\x5b\x3c\xfd\x6f\x32\xd8\x49\x4b\x38\x24\x26\x12\xa3\x25\xb2\xdb\x33\x5a\x15\x7f\x97\x12\x37\x19\x11\x04\x4f\xa9\x34\xce\x1a\x02\x06\xc5\xf7\xf0\xc9\xc3\x88\xdb\xdf\x72\x01\x0a\xa5\x0a\x07\x4d\xde\xab\x8d\xf4\x78\xde\x72\xf1\xa3\x19\xf4\x25\x06\xe6\xbd\x6e\x5d\xb3\x6b\x7a\xc4\x90\x38\xf4\x59\x0d\x24\xd6\xd0\xbf\x06\xa0\x57\xc5\x50\xd9\x72\x40\x3b\x39\xec\xf8\x43\x57\x24\x6f\x7f\xfb\x97\xee\xb1\x7a\x23\xd5\xac\xd9\x17\x44\x61\x7a\xfa\xfd\x52\x66\x78\x76\xd3\xad\x6b\x92\x2f\xd8\x41\x65\x99\x9b\xab\xe6\x9a\x06\x4c\xa2\xfa\xea\xba\xed\x4d\x15\x11\x1b\x54\x83\x09\xaf\x6d\xbc\x18\x57\x50\xf2\x86\x15\x81\x84\xd4\x3c\x98\x96\x30\x39\x97\xfb\xda\xf4\x84\x32\xa9\xcf\x60\x92\x20\x0e\xa5\x27\x99\xc0\x0c\x7d\xcf\xdd\xa0\x2f\x00\x2c\x88\x73\x33\xc9\x7e\x3c\xf9\x2e\xa7\xaf\xd0\xd4\xc8\x64\x23\x30\x1e\x6e\xc0\x8e\xa8\xbc\x72\x65\xb7\xdb\x1b\x1a\xfc\xd0\x8d\x51\x27\xdd\x1c\x15\xd2\x59\x1a\xa3\x8f\xc9\xa2\x9d\x29\x84\xac\x49\x25\xd8\x12\xc5\xf8\xdd\xbc\x23\x70\xc3\xd7\xe4\xec\x3c\xcb\x82\x6b\x25\xb3\xb7\x4a\xfc\x22\xc2\x06\x93\x6e\xea\x74\xef\x64\x5f\x57\xe0\x5e\xe9\xce\x02\x04\x61\x1b\x8c\xcf\x76\x21\x8f\xbf\x08\x7f\x3f\x89\xb7\x9f\x19\x27\x59\x16\x4c\x1f\xfb\x56\x1a\x4e\xdc\x75\x1c\x1f\x82\xa9\xfc\x13\x5a\xdc\xc4\x6c\x77\x70\x96\x70\x20\x10\xbf\x49\x25\xd1\x9b\x54\x33\x5f\x08\xea\xdd\x00\x5a\x72\x32\x90\x70\xc4\xb8\x41\x9d\x21\x95\x68\xb0\x77\x1d\xbc\xc3\x7a\x8f\xa2\xbb\x10\x4c\xfb\xf9\xf8\xd8\x20\xc9\xff\xb1\x81\x3e\xc2\x48\x39\x7d\x41\x3e\x2f\x2c\x86\x44\x15\xad\x23\x39\x1d\xb7\xa1\xa1\xa3\xb7\xc0\x03\xcb\x4e\x1e\x33\xed\x24\x61\xdb\xf4\x85\x3a\xa8\xe4\xa3\x17\x1f\xb0\x82\xfb\x20\x40\xcd\x6f\xfd\xb7\xb8\xb0\x82\xcc\xbd\xaf\xcd\xca\xbe\x45\x7c\x81\x68\x36\xf5\xe4\xa4\xdf\xd7\x5e\x26\xae\x3f\x96\x48\x4a\xed\x5e\xc5\x6a\xa1\xf6\x75\xef\x85\x32\x23\x5f\xdb\xf9\x46\xd0\x2c\x84\x5d\x40\x50\x66\xdb\x06\xc8\x5e\x83\x0b\x49\x0e\x38\x7d\x73\x6d\xf6\xce\x41\xf1\x65\xda\x7a\xbe\xd7\x78\xf8\x7f\x00\x00\x00\xff\xff\xf7\xe7\x87\x1b\x52\x23\x00\x00" func flowcontractauditsCdcBytes() ([]byte, error) { @@ -364,6 +386,26 @@ func epochsFlowepochCdc() (*asset, error) { return a, nil } +var _testcontractsBurnabletestCdc = "\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\x7c\x91\x41\x4b\xfb\x40\x10\xc5\xef\xf9\x14\x8f\x9c\x52\xfe\x7f\x8b\x82\x78\x08\x16\xa4\x7a\xf1\xac\xc5\xa3\x6c\xe2\x44\x83\x9b\xdd\x32\x3b\xab\x48\xe9\x77\x97\xc4\xa4\x9d\x6d\xab\x7b\xdc\x99\xf9\xbd\x37\x6f\xda\x6e\xed\x59\x90\x2f\x23\x3b\xe2\x3c\xcb\xd6\xb1\x42\xed\x9d\xb0\xa9\x05\xfd\xaf\xa9\x2c\x3d\x52\x10\x6c\x32\x00\xe8\xeb\x1f\x86\x21\x5e\x8c\x1d\xa6\x5e\x4a\xac\xee\x9d\x5c\x5d\x66\xbb\x06\xa6\xe0\x23\xd7\x84\xa7\x56\xde\x6e\x8d\xb5\x95\xa9\xdf\x4b\xfc\x88\xcc\x27\xea\x48\x9c\x86\x2c\x09\x8c\xb5\xfe\xf3\x8e\x82\xb0\xff\x2a\xb1\xf4\xde\x66\x49\x4f\x13\x1d\xaa\xc8\x6e\x62\x16\x33\x05\xe9\x9f\x09\x81\x58\x8a\x40\xb6\x99\x6b\xd8\x7f\x74\x14\x82\x79\xa5\x12\xb9\xfe\x47\x17\x83\xa0\x22\x04\x12\x88\x87\x70\xa4\x7c\x96\x20\x75\x08\x73\xb5\x36\x16\xbf\x97\xfe\xe1\x62\xc7\xd8\xee\x57\x68\x5d\x2b\xc5\xf3\x89\x2d\x0f\xd7\x38\xf2\x8f\x45\x32\xa5\xe0\x4a\xe2\x28\x7a\x1f\x65\x4a\x0a\x1b\xd5\xd4\xc7\x58\x33\x19\xa1\x07\xd3\x50\x71\xc2\x4f\x89\x1b\x7d\x3b\x65\x8f\x49\x22\x3b\x5c\x9f\x8d\x84\xe4\xc6\x09\x6a\x76\xe8\x6d\x2f\xbb\x72\xa1\x17\x9e\x64\x12\x9f\x7f\x2b\xa9\xd6\x22\x11\x18\xb2\xd5\x39\x0e\x19\xa6\xf7\x3a\x1f\x07\xb6\xdf\x01\x00\x00\xff\xff\x44\x1b\xd9\xf9\xf7\x02\x00\x00" + +func testcontractsBurnabletestCdcBytes() ([]byte, error) { + return bindataRead( + _testcontractsBurnabletestCdc, + "testContracts/BurnableTest.cdc", + ) +} + +func testcontractsBurnabletestCdc() (*asset, error) { + bytes, err := testcontractsBurnabletestCdcBytes() + if err != nil { + return nil, err + } + + info := bindataFileInfo{name: "testContracts/BurnableTest.cdc", size: 0, mode: os.FileMode(0), modTime: time.Unix(0, 0)} + a := &asset{bytes: bytes, info: info, digest: [32]uint8{0x51, 0xe7, 0xd, 0x68, 0x3b, 0x80, 0xc, 0xb9, 0xcf, 0xd3, 0xb9, 0x88, 0xa5, 0xac, 0xaf, 0x6c, 0xc8, 0xed, 0x9e, 0xd2, 0xa4, 0x4c, 0x4d, 0x6, 0x49, 0x6, 0x2a, 0x32, 0xd7, 0x4c, 0x33, 0x40}} + return a, nil +} + var _testcontractsTestflowidtablestakingCdc = "\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\xec\x59\x5f\x6f\x1b\xb9\x11\x7f\xd7\xa7\x18\xf8\xa1\xb5\x02\x9f\x9d\x4b\xae\x45\x61\x44\x4d\x0d\x2b\x29\x84\xdc\xf9\x0e\xb1\xd3\x3c\x1c\x0e\x01\xb5\x3b\x92\x58\x53\xa4\x8e\xe4\x5a\x16\x02\x7f\xf7\x62\x48\x2e\x77\xb9\xff\x24\x25\x6d\xef\x25\x7a\x88\x62\x71\x38\x9c\xff\xf3\x1b\xf2\xe2\xd9\x68\x04\x00\x70\x87\xc6\xbe\x15\x6a\x3b\x9b\xde\xb1\xb9\xc0\x5b\xcb\xee\xb9\x5c\x86\xb5\x15\x37\xc0\x0d\x30\xb0\x68\x2c\x64\x4a\x5a\xcd\x32\x0b\x56\x01\x7d\x31\x03\x4c\xc2\xd5\x2f\x33\x58\x28\xed\x36\x10\x19\x97\x4b\xb0\x2b\x04\xa1\xb2\xfb\xb9\x7a\x04\x26\x73\x30\x9e\x2b\x6c\xb4\x7a\xdc\x45\x3e\xe6\x7c\x34\x82\x67\x17\xa3\x11\x5f\x6f\x94\xb6\xf0\xb6\x90\x4b\x3e\x17\x78\xa7\xee\x51\xc2\x42\xab\x35\x9c\x24\xbf\x9d\x44\x4a\xa1\xb6\x35\xaa\xe7\x8f\x6f\x7f\xfc\xf9\xe3\xdd\xcf\xef\xde\xdc\x5c\x4d\xa7\xef\xdf\xdc\xde\x8e\x46\x9b\x62\x5e\x09\xdc\x56\x10\x3e\x7b\x15\x2f\x9e\x55\x1f\x98\x4d\xc1\xd1\x38\x99\x4b\xc2\x6b\xb5\xde\x28\xc3\x2d\xc2\xdd\x6e\x83\x30\xc5\x05\x97\xdc\x72\x25\x0d\x3c\xab\x7f\x2e\x02\xc3\x8b\x0b\xb8\x56\xd2\x32\x2e\x0d\x70\xb9\x50\x7a\xcd\x88\x1a\xec\x8a\x59\x32\xa6\xd9\x60\xc6\x17\x3c\x73\x56\x04\xa9\x72\x04\x2e\x9d\x84\x71\xbf\x92\x62\x07\x82\x3f\x20\x71\x00\x4b\x5e\x28\x55\x71\x34\xa4\x9b\x46\xa3\x0a\x9d\x21\xdc\xa8\x1c\xdf\x63\xa6\x74\x5e\xea\x54\xb2\xb9\x5b\x21\x14\x92\xff\x5e\x20\x69\xa6\x16\xce\x2d\x74\x60\x42\x75\x8b\x16\xb6\x2b\x94\x71\x95\x84\xcc\x34\x32\x8b\x79\x24\xa4\x13\x05\x5a\xe0\xf9\x25\xdc\x5a\x1d\x23\xa4\x7e\x94\x25\xf3\xa8\x85\xe3\x71\x99\xac\x7e\x0f\x13\xc8\x94\x10\x98\x91\x25\x92\xa5\x17\x6e\x49\x1a\x94\xa6\x30\xc9\xca\x4b\x98\x00\x3e\x62\x56\xb4\xf6\xfc\x00\x13\x78\x40\x4d\x46\x64\xad\xc5\xbf\xc0\x04\x58\x96\xa1\x31\x89\xf0\x0f\x4c\x83\x56\x02\x2f\xe1\xc3\x4c\xda\xbf\xb5\xa5\x67\x79\xae\xd1\x18\x28\x0c\xe6\x14\xcf\x20\xd1\x6e\x95\x76\xc9\x50\x63\x74\x6a\xd0\x8e\x1d\xb7\x6a\xfd\xca\x6f\xed\xb6\x0c\x59\x75\x53\xcc\x05\xcf\xe0\x1e\x77\x47\x72\x7e\x87\xbb\x83\xb9\x86\x1c\xeb\x66\x19\x16\x3b\xf9\x51\x38\x9f\xc6\xbf\xdc\x2f\xd1\xcb\x67\xc9\xef\x35\x03\x9e\x79\x39\xe8\x17\x1f\xd9\x31\x7a\xb6\x5c\x08\x58\xb1\x07\x74\x52\x2d\x0a\x5b\x68\x04\xdc\xa8\x6c\x65\x12\x66\xbd\xf6\x3b\xeb\x21\xab\x09\x9f\x92\xb4\x95\x4b\xd7\x2d\x55\x0a\x73\xad\xd6\x6b\x6e\x2d\xe6\x97\xf0\x8f\xa4\xaa\x9c\xff\x8b\x15\xc2\xc6\x1d\xe3\x7a\x1a\x39\xf6\x28\x16\xe7\x3c\x87\x09\xf0\xbc\xbd\xe0\x2c\x30\x71\x86\x68\x2f\xb6\x74\x84\x49\x5b\xef\xa1\x6d\xef\x70\x97\x6c\x79\x87\xbb\x36\x79\xa5\x3f\x4c\x6a\xc6\x48\xb5\xc8\xd1\x58\xad\x76\x4d\x63\x44\x9a\xa7\x91\xff\xb7\x16\x66\x64\xcc\xc2\x97\x7b\x5f\x0f\xe8\x7f\x4b\xb4\xa0\x91\xe5\xdf\xb9\x22\x45\x05\x0e\xd8\x5c\x15\x36\xd4\xb2\x58\x9f\x8c\xdf\x4b\xd5\x69\x46\x44\x9f\x87\x6a\x49\x73\xa9\x9e\xa9\xcd\xb5\xfe\xbc\xeb\xa7\xac\xc7\x7d\x93\xaa\x23\x35\x9a\x24\xde\x66\xd4\x10\x28\x7a\x3e\xbc\xe5\x8f\x7f\xfd\xa1\x83\xc8\x32\x71\x77\x18\x65\x23\x1e\x07\xe9\x3e\xc8\x20\xe1\x41\x74\x7b\xd9\xbd\xc7\x2d\xd3\x79\x8d\x2c\xa9\x2b\x82\x1b\x4b\x35\x3c\x47\x81\x4b\x66\x95\x86\xd9\xd4\xb8\x44\x76\x5d\xc8\x25\xb8\xda\xa0\xa6\xa5\xd6\x01\x71\x93\xb9\x84\x5f\xc9\x79\x2f\x5f\xfc\xd6\x4f\x34\x9b\x5e\xab\x42\x5a\xd4\xde\xd1\x2f\x5f\xf4\x0a\xfc\x7b\x81\xc6\x62\x7e\xa7\x82\x8a\xbd\x1a\xba\xc6\xcc\xc4\x47\xe4\xcb\x95\xf5\x6c\xeb\x0a\xba\x42\x47\x2a\xcc\xa6\xa5\xab\x07\x92\xdd\x13\xf6\x26\xfc\x8b\xc3\xb2\xfd\x24\xf4\x95\x93\xfd\x59\x7e\x72\x8f\xbb\x0e\xb2\x24\xbb\x7b\x68\xea\x01\x0a\x13\x78\x7e\xfe\xbc\x8b\xa6\x11\x9f\xfd\x84\x49\x78\x0e\x93\xc5\xe8\x3c\x84\x6c\x1f\xb3\x32\x36\xfb\xa8\xaa\x00\x83\x09\xfc\xfa\xdb\x00\x41\x0c\x2e\x62\xd5\x7f\x5c\x33\xb2\xfa\x0e\x4e\x02\x2b\x61\x99\x94\x4d\xca\xa0\xf7\x25\x2e\x4b\xbb\x62\x99\x34\x1e\xc8\x29\x61\x5a\x3d\xbb\x05\xea\x9c\x97\x74\x13\xd4\x7d\x88\x80\xce\x67\x25\xee\x49\xca\x2e\xc4\xe6\x12\xa1\x5a\x18\xd7\x8a\x33\xf4\x35\xbc\x5a\x67\x20\xd6\x8b\x42\x42\xb1\xc9\x99\xc5\x9b\x66\xd4\x9f\x7e\x02\x89\xdb\x46\x71\x6e\x9e\xd1\xc5\x97\xd4\xbb\xca\x73\xda\x1d\x72\x9f\x1a\x0e\xa9\x68\x76\xc6\xe2\x9a\xfe\xf2\x6e\xca\x0b\x5d\x8e\x19\x12\x1f\xad\x87\x17\x2d\xf9\x1c\xed\x0d\xfa\x49\x81\xc4\xf2\x4c\xbb\xfb\x7f\xab\x12\xa4\x0d\xb3\x4f\x5e\xe7\xa4\x28\x2d\xb9\x9c\x69\xf4\xa8\x1d\x1b\x85\x19\xe6\x45\x76\x8f\x36\xd9\x3e\x2f\xac\xc3\x4a\xf2\xcf\x16\xe6\x88\x12\xd4\x62\xc1\x33\xce\x84\xd8\x79\xf1\xf3\x6e\xad\x4a\x9e\x41\x35\xb6\xa6\x68\x2f\xeb\x62\xa2\xca\xf1\xf2\xc6\x2c\xfc\x2f\xca\x5b\xf2\x3c\x5a\xde\x90\xa3\xe0\x77\xd4\xc2\x62\x8e\xa0\x71\xad\x1e\x08\xad\xd3\x0c\xd8\x84\xbf\xb4\x39\x24\x20\xca\x3c\x4e\x3f\xfd\xd1\xa2\xfd\x49\xb1\xa0\x1d\x2f\xa4\x93\xab\x08\x95\x84\x09\x51\x1f\xb9\x62\x82\x9a\x60\x27\x37\x63\x66\xb1\xc8\x7a\xc5\xce\x52\xf1\x0d\x6c\x51\x08\x37\x67\x0b\xe1\x13\xa1\x7f\x2f\x9d\x56\x1d\xca\x75\xad\x1d\xb7\x33\xd7\x0b\x79\x25\xc4\xe9\x90\x5e\x1f\xb9\x5d\xe5\x9a\xc5\x6c\x74\x86\xb6\x6e\xaa\xec\x0e\xe9\x92\xff\x36\x6c\x1c\x0e\xd3\xee\x44\x6c\x14\x0a\xaa\x61\x8b\x72\xdc\xff\x89\x87\x9a\xde\x1e\xe8\xcf\x59\x96\x11\xf7\xf3\xb9\xd2\x5a\x6d\x5f\xfd\x29\xde\x11\x9c\xfb\x5d\x7f\x3f\x25\xf1\x2f\xe1\xc2\x58\xa5\xd9\x12\x2f\x1a\x5c\xc7\xc9\xb1\xf4\x79\xfd\x1a\x36\x4c\xf2\xec\xf4\xe4\x5a\x15\x22\x07\xa9\x2c\x78\xee\xb0\xf6\x82\x68\x5c\xa0\x46\x99\xe1\xc9\x38\x2d\x1e\x1a\x6d\xa1\x25\xbc\xfa\xae\x29\xfb\x39\xed\x6c\x98\xc3\x7f\x8f\x8f\x77\x83\xee\xc9\xd4\xa6\x1b\x86\xb3\xef\x9b\x1b\x52\x37\x34\xbc\x10\xbe\x6a\x33\xcd\x34\xa2\x0c\x3f\xd8\x74\xf6\xdc\x1e\x4c\x9b\xc2\xcf\xaf\x1c\x0d\x0e\x9a\x33\x0e\x9d\x1f\x5a\x83\xc1\x10\xbb\x03\xc6\x8c\x5e\xd4\x3e\x84\xc7\xcf\xea\xf3\x41\x69\xc4\x01\x90\x5e\xa3\xee\x00\xd8\x8e\xf5\x00\x94\x3f\x0a\xe9\x1e\x02\x9a\xff\xaf\x68\xf8\x40\x10\x9b\x86\x71\x02\x51\xd5\xfc\xdf\x48\xf3\x7d\x89\x54\xab\xa9\x8f\x92\xb3\xbc\x7d\xa4\x5e\x12\xb2\x3a\xb2\xb0\x0a\x36\xa8\x17\x4a\xc7\xc6\x0b\xcc\x5d\xee\x99\x6e\x2c\x1b\x53\xa6\x09\x67\xdf\xb0\x6c\x55\x3b\x97\x30\x2d\x6b\x20\xe6\x15\xf5\xbf\xea\x22\x73\x28\xdb\x5a\xb7\x7a\xe9\xbd\x67\xc5\x33\xa8\xcc\x4d\xed\xec\xf0\x3f\xa4\x36\xbe\x2f\x6f\xdb\x50\xda\x4b\x70\x06\xed\xf9\xb2\x3b\x72\xbb\xee\x92\xfa\x02\xb6\xd1\x0f\x82\x31\xb1\x03\x28\xf7\xcf\x02\xd4\x0f\x4a\x0d\x2b\x4c\xec\x6b\xf1\x51\x78\x98\xb6\xec\x95\x6c\x0f\x60\x38\x4e\xdc\x2f\x06\xbb\xbd\xe2\xf8\xc6\x69\xbe\x48\x9a\xaf\x86\xb2\x35\x90\x58\xf2\x8c\x18\xee\xb0\xc1\xe6\x2b\xa0\xea\x37\x48\xf7\x47\x62\x89\xbd\x5e\xf8\x86\xe8\xfe\xb7\x5e\x80\xb4\x13\x5e\xc9\x9d\xcf\xfa\x8c\x49\xc8\xfc\x90\xc5\x0d\x59\x3a\xf3\x6f\x76\x0a\x34\x2e\xb9\x21\x91\x98\x2b\xb7\x37\xe5\x1d\x37\x6d\x9f\xd9\x20\x8f\x09\xce\x0b\x1d\xcf\x3d\xf2\xa8\x1c\x4d\x6c\xad\x3b\x77\x82\xeb\xaa\xc0\x65\xd5\x46\xeb\xcd\x15\x82\xfd\x46\x75\x87\xb3\x3c\xaf\x1e\xf8\xaa\x57\x9a\xae\x17\x9a\xfa\xeb\x4c\xfc\xf1\x80\x57\x96\x3d\x2f\x2c\x43\xaf\x2b\x87\xbf\xac\x50\x4c\x26\x97\x5a\x25\x8b\xbe\x77\x89\x5a\xbe\x94\x4e\xaf\x3c\x10\xb8\x34\xf1\x4b\xda\xe3\x87\x30\x4c\x12\x4a\xe1\x71\xa3\x62\xec\x1a\x3a\xcf\xc7\xad\x01\xc0\x17\x5f\x1f\x10\x37\xb8\x8d\xa8\xa6\x85\x62\x0f\x32\x4c\x69\x93\x4e\x70\xb4\xd7\x2e\x5d\xe2\x57\x02\x91\x06\xdf\x57\x68\xc4\x7f\x8f\x9b\xf1\xff\x4f\xb4\x3e\x74\xd7\x5c\xf2\x75\xb1\x0e\xd7\x6b\xd4\x5f\xb8\xc6\x35\x4a\xeb\x62\xb9\x71\x93\x50\x5a\x62\x89\x36\x1e\xf8\x93\x67\x70\xeb\x2f\x7b\xe2\xf6\xd3\x71\x59\x94\x6a\x2e\x0f\x92\x3b\xc8\x53\x16\x97\x4c\x6d\x76\xaf\x3c\x65\xab\x9e\xc4\xe3\x43\x45\x0a\x67\xa5\x75\xe5\xf5\xeb\x88\x7a\x83\x82\x0e\x9a\x7d\xf2\x2d\xd4\x59\xfd\x17\xb6\x53\x45\xac\x92\x67\xf0\x29\x94\xdb\xeb\xf4\xc7\x8c\xc9\x9c\xe7\xcc\xe2\x8f\x7c\xcd\xad\xb9\x84\xcf\x2e\xa7\xca\xf7\x84\xa7\x12\xd3\x3d\x8d\x9e\x46\xff\x09\x00\x00\xff\xff\x3e\x49\x82\x0e\x46\x21\x00\x00" func testcontractsTestflowidtablestakingCdcBytes() ([]byte, error) { @@ -475,6 +517,7 @@ func AssetNames() []string { // _bindata is a table, holding each asset generator, mapped to its name. var _bindata = map[string]func() (*asset, error){ + "Burner.cdc": burnerCdc, "FlowContractAudits.cdc": flowcontractauditsCdc, "FlowFees.cdc": flowfeesCdc, "FlowIDTableStaking.cdc": flowidtablestakingCdc, @@ -489,6 +532,7 @@ var _bindata = map[string]func() (*asset, error){ "epochs/FlowClusterQC.cdc": epochsFlowclusterqcCdc, "epochs/FlowDKG.cdc": epochsFlowdkgCdc, "epochs/FlowEpoch.cdc": epochsFlowepochCdc, + "testContracts/BurnableTest.cdc": testcontractsBurnabletestCdc, "testContracts/TestFlowIDTableStaking.cdc": testcontractsTestflowidtablestakingCdc, } @@ -536,6 +580,7 @@ type bintree struct { } var _bintree = &bintree{nil, map[string]*bintree{ + "Burner.cdc": {burnerCdc, map[string]*bintree{}}, "FlowContractAudits.cdc": {flowcontractauditsCdc, map[string]*bintree{}}, "FlowFees.cdc": {flowfeesCdc, map[string]*bintree{}}, "FlowIDTableStaking.cdc": {flowidtablestakingCdc, map[string]*bintree{}}, @@ -553,6 +598,7 @@ var _bintree = &bintree{nil, map[string]*bintree{ "FlowEpoch.cdc": {epochsFlowepochCdc, map[string]*bintree{}}, }}, "testContracts": {nil, map[string]*bintree{ + "BurnableTest.cdc": {testcontractsBurnabletestCdc, map[string]*bintree{}}, "TestFlowIDTableStaking.cdc": {testcontractsTestflowidtablestakingCdc, map[string]*bintree{}}, }}, }} diff --git a/lib/go/test/go.sum b/lib/go/test/go.sum index 1ca829823..47e3c79f9 100644 --- a/lib/go/test/go.sum +++ b/lib/go/test/go.sum @@ -146,6 +146,7 @@ github.com/cockroachdb/pebble v0.0.0-20230906160148-46873a6a7a06 h1:T+Np/xtzIjYM github.com/cockroachdb/pebble v0.0.0-20230906160148-46873a6a7a06/go.mod h1:bynZ3gvVyhlvjLI7PT6dmZ7g76xzJ7HpxfjgkzCGz6s= github.com/cockroachdb/redact v1.1.3 h1:AKZds10rFSIj7qADf0g46UixK8NNLwWTNdCIGS5wfSQ= github.com/cockroachdb/redact v1.1.3/go.mod h1:BVNblN9mBWFyMyqK1k3AAiSxhvhfK2oOZZ2lK+dpvRg= +github.com/cockroachdb/sentry-go v0.6.1-cockroachdb.2/go.mod h1:8BT+cPK6xvFOcRlk0R8eg+OTkcqI6baNH4xAkpiYVvQ= github.com/codegangsta/inject v0.0.0-20150114235600-33e0aa1cb7c0/go.mod h1:4Zcjuz89kmFXt9morQgcfYZAYZ5n8WHjt81YYWIwtTM= github.com/coreos/bbolt v1.3.2/go.mod h1:iRUV2dpdMOn7Bo10OQBFzIJO9kkE559Wcmn+qkEiiKk= github.com/coreos/etcd v3.3.10+incompatible/go.mod h1:uF7uidLiAD3TWHmW31ZFd/JWoc32PjwdhPthX9715RE= @@ -242,6 +243,7 @@ github.com/go-kit/log v0.2.1 h1:MRVx0/zhvdseW+Gza6N9rVzU/IVzaeE1SFI4raAhmBU= github.com/go-logfmt/logfmt v0.3.0/go.mod h1:Qt1PoO58o5twSAckw1HlFXLmHsOX5/0LbT9GBnD5lWE= github.com/go-logfmt/logfmt v0.4.0/go.mod h1:3RMwSq7FuexP4Kalkev3ejPJsZTpXXBr9+V4qmtdjCk= github.com/go-logfmt/logfmt v0.5.1 h1:otpy5pqBCBZ1ng9RQ0dPu4PN7ba75Y/aA+UpowDyNVA= +github.com/go-logfmt/logfmt v0.5.1/go.mod h1:WYhtIu8zTZfxdn5+rREduYbwxfcBr/Vr6KEVveWlfTs= github.com/go-logr/logr v1.2.2/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= github.com/go-logr/logr v1.2.4 h1:g01GSCwiDw2xSZfjJ2/T9M+S6pFdcNtFYsp+Y43HYDQ= github.com/go-logr/logr v1.2.4/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= @@ -378,6 +380,8 @@ github.com/grpc-ecosystem/grpc-gateway v1.16.0/go.mod h1:BDjrQk3hbvj6Nolgz8mAMFb github.com/grpc-ecosystem/grpc-gateway/v2 v2.7.0/go.mod h1:hgWBS7lorOAVIJEQMi4ZsPv9hVvWI6+ch50m39Pf2Ks= github.com/grpc-ecosystem/grpc-gateway/v2 v2.11.3 h1:lLT7ZLSzGLI08vc9cpd+tYmNWjdKDqyr/2L+f6U12Fk= github.com/grpc-ecosystem/grpc-gateway/v2 v2.11.3/go.mod h1:o//XUCC/F+yRGJoPO/VU0GSB0f8Nhgmxx0VIRUvaC0w= +github.com/gxed/hashland/keccakpg v0.0.1/go.mod h1:kRzw3HkwxFU1mpmPP8v1WyQzwdGfmKFJ6tItnhQ67kU= +github.com/gxed/hashland/murmur3 v0.0.1/go.mod h1:KjXop02n4/ckmZSnY2+HKcLud/tcmvhST0bie/0lS48= github.com/hashicorp/errwrap v1.0.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4= github.com/hashicorp/errwrap v1.1.0 h1:OxrOeh75EUXMY8TBjag2fzXGZ40LB6IKw45YeGUDY2I= github.com/hashicorp/errwrap v1.1.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4= @@ -447,14 +451,17 @@ github.com/jbenet/goprocess v0.1.4 h1:DRGOFReOMqqDNXwW70QkacFW0YN9QnwLV0Vqk+3oU0 github.com/jbenet/goprocess v0.1.4/go.mod h1:5yspPrukOVuOLORacaBi858NqyClJPQxYZlqdZVfqY4= github.com/jessevdk/go-flags v0.0.0-20141203071132-1679536dcc89/go.mod h1:4FA24M0QyGHXBuZZK/XkWh8h0e1EYbRYJSGM75WSRxI= github.com/jonboulle/clockwork v0.1.0/go.mod h1:Ii8DK3G1RaLaWxj9trq07+26W01tbo22gdxWY5EU2bo= +github.com/jpillora/backoff v1.0.0/go.mod h1:J/6gKK9jxlEcS3zixgDgUAsiuZ7yrSoa/FX5e0EB2j4= github.com/jrick/logrotate v1.0.0/go.mod h1:LNinyqDIJnpAur+b8yyulnQw/wDuN1+BYKlTRt3OuAQ= github.com/json-iterator/go v1.1.6/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCVDaaPEHmU= github.com/json-iterator/go v1.1.9/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= +github.com/json-iterator/go v1.1.12/go.mod h1:e30LSqwooZae/UwlEbR2852Gd8hjQvJoHmT4TnhNGBo= github.com/jstemmer/go-junit-report v0.0.0-20190106144839-af01ea7f8024/go.mod h1:6v2b51hI/fHJwM22ozAgKL4VKDeJcHhJFhtBdhmNjmU= github.com/jstemmer/go-junit-report v0.9.1/go.mod h1:Brl9GWCQeLvo8nXZwPNNblvFj/XSXhF0NWZEnDohbsk= github.com/jtolds/gls v4.20.0+incompatible/go.mod h1:QJZ7F/aHp+rZTRtaJ1ow/lLfFfVYBRgL+9YlvaHOwJU= github.com/julienschmidt/httprouter v1.1.1-0.20170430222011-975b5c4c7c21/go.mod h1:SYymIcj16QtmaHHD7aYtjjsJG7VTCxuUUipMqKk8s4w= github.com/julienschmidt/httprouter v1.2.0/go.mod h1:SYymIcj16QtmaHHD7aYtjjsJG7VTCxuUUipMqKk8s4w= +github.com/julienschmidt/httprouter v1.3.0/go.mod h1:JR6WtHb+2LUe8TCKY3cZOxFyyO8IZAc4RVcycCCAKdM= github.com/jung-kurt/gofpdf v1.0.3-0.20190309125859-24315acbbda5/go.mod h1:7Id9E/uU8ce6rXgefFLlgrJj/GYY22cpxn+r32jIOes= github.com/k0kubun/colorstring v0.0.0-20150214042306-9440f1994b88/go.mod h1:3w7q1U84EfirKl04SVQ/s7nPm1ZPhiXd34z40TNz36k= github.com/k0kubun/go-ansi v0.0.0-20180517002512-3bf9e2903213/go.mod h1:vNUNkEQ1e29fT/6vq2aBdFsgNPmy8qMdSay1npru+Sw= @@ -566,6 +573,7 @@ github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJ github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= github.com/modern-go/reflect2 v0.0.0-20180701023420-4b7aa43c6742/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= github.com/modern-go/reflect2 v1.0.1/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= +github.com/modern-go/reflect2 v1.0.2/go.mod h1:yWuevngMOJpCy52FWWMvUC8ws7m/LJsjYzDa0/r8luk= github.com/moul/http2curl v1.0.0/go.mod h1:8UbvGypXm98wA/IqH45anm5Y2Z6ep6O31QGOAZ3H0fQ= github.com/mr-tron/base58 v1.1.0/go.mod h1:xcD2VGqlgYjBdcBLw+TuYLr8afG+Hj8g2eTVqeSzSU8= github.com/mr-tron/base58 v1.1.3/go.mod h1:BinMc/sQntlIE1frQmRFPUoPA1Zkr8VRgBdjWI2mNwc= @@ -593,6 +601,7 @@ github.com/multiformats/go-varint v0.0.5/go.mod h1:3Ls8CIEsrijN6+B7PbrXRPxHRPuXS github.com/multiformats/go-varint v0.0.7 h1:sWSGR+f/eu5ABZA2ZpYKBILXTTs9JWpdEM/nEGOHFS8= github.com/multiformats/go-varint v0.0.7/go.mod h1:r8PUYw/fD/SjBCiKOoDlGF6QawOELpZAu9eioSos/OU= github.com/mwitkow/go-conntrack v0.0.0-20161129095857-cc309e4a2223/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= +github.com/mwitkow/go-conntrack v0.0.0-20190716064945-2f068394615f/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= github.com/naoina/go-stringutil v0.1.0/go.mod h1:XJ2SJL9jCtBh+P9q5btrd/Ylo8XwT/h1USek5+NqSA0= github.com/naoina/toml v0.1.2-0.20170918210437-9fafd6967416/go.mod h1:NBIhNtsFMo3G2szEBne+bO4gS192HuIYRqfvOWb4i1E= github.com/nats-io/jwt v0.3.0/go.mod h1:fRYCDE99xlTsqUzISS1Bi75UBJ6ljOJQOAAu5VglpSg= @@ -601,6 +610,7 @@ github.com/nats-io/nkeys v0.1.0/go.mod h1:xpnFELMwJABBLVhffcfd1MZx6VsNRFpEugbxzi github.com/nats-io/nuid v1.0.1/go.mod h1:19wcPz3Ph3q0Jbyiqsd0kePYG7A95tJPxeL+1OSON2c= github.com/nxadm/tail v1.4.4/go.mod h1:kenIhsEOeOJmVchQTgglprH7qJGnHDVpk1VPCcaMI8A= github.com/nxadm/tail v1.4.8 h1:nPr65rt6Y5JFSKQO7qToXr7pePgD6Gwiw05lkbyAQTE= +github.com/nxadm/tail v1.4.8/go.mod h1:+ncqLTQzXmGhMZNUePPaPqPvBxHAIsmXswZKocGu+AU= github.com/oklog/ulid v1.3.1/go.mod h1:CirwcVhetQ6Lv90oh/F+FBtV6XMibvdAFo93nm5qn4U= github.com/olekukonko/tablewriter v0.0.1/go.mod h1:vsDQFd/mU46D+Z4whnwzcISnGGzXWMclvtLoiIKAKIo= github.com/olekukonko/tablewriter v0.0.2-0.20190409134802-7e037d187b0c/go.mod h1:vsDQFd/mU46D+Z4whnwzcISnGGzXWMclvtLoiIKAKIo= @@ -807,6 +817,7 @@ github.com/vmihailenco/msgpack/v4 v4.3.11 h1:Q47CePddpNGNhk4GCnAx9DDtASi2rasatE0 github.com/vmihailenco/msgpack/v4 v4.3.11/go.mod h1:gborTTJjAo/GWTqqRjrLCn9pgNN+NXzzngzBKDPIqw4= github.com/vmihailenco/tagparser v0.1.1 h1:quXMXlA39OCbd2wAdTsGDlK9RkOk6Wuw+x37wVyIuWY= github.com/vmihailenco/tagparser v0.1.1/go.mod h1:OeAg3pn3UbLjkWt+rN9oFYB6u/cQgqMEUPoW2WPyhdI= +github.com/whyrusleeping/go-logging v0.0.0-20170515211332-0457bb6b88fc/go.mod h1:bopw91TMyo8J3tvftk8xmU2kPmlrt4nScJQZU2hE5EM= github.com/wsddn/go-ecdh v0.0.0-20161211032359-48726bab9208/go.mod h1:IotVbo4F+mw0EzQ08zFqg7pK3FebNXpaMsRy2RT+Ees= github.com/x448/float16 v0.8.4 h1:qLwI1I70+NjRFUR3zs1JPUCgaCXSh3SW62uAKT1mSBM= github.com/x448/float16 v0.8.4/go.mod h1:14CWIYCyZA/cWjXOioeEpHeN/83MdbZDRQHoFcYsOfg= @@ -1375,6 +1386,7 @@ gopkg.in/yaml.v2 v2.2.4/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.8/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.3.0/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY= +gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ= gopkg.in/yaml.v3 v3.0.0-20191120175047-4206685974f2/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= diff --git a/tests/test_burner.cdc b/tests/test_burner.cdc new file mode 100644 index 000000000..378195435 --- /dev/null +++ b/tests/test_burner.cdc @@ -0,0 +1,98 @@ +import Test +import BlockchainHelpers + +pub fun setup() { + Test.deployContract(name: "Burner", path: "../contracts/Burner.cdc", arguments: []) + Test.deployContract(name: "BurnableTest", path: "../contracts/testContracts/BurnableTest.cdc", arguments: []) +} + +pub fun testWithCallbackDestory_Allowed() { + let acct = Test.createAccount() + txExecutor( + "burner/create_and_destroy_with_callback.cdc", + [acct], + [true] + ) +} + +pub fun testWithCallback_NotAllowed() { + let acct = Test.createAccount() + + Test.expectFailure(fun() { + txExecutor( + "burner/create_and_destroy_with_callback.cdc", + [acct], + [false] + ) + }, errorMessageSubstring: "allowDestroy must be set to true") +} + +pub fun testWithoutCallbackDestroy_Allowed() { + let acct = Test.createAccount() + txExecutor( + "burner/create_and_destroy_without_callback.cdc", + [acct], + [] + ) +} + +pub fun testDestroy_Dict() { + let acct = Test.createAccount() + + let types = [Type
(), Type