Skip to content

Commit

Permalink
Updating contracts
Browse files Browse the repository at this point in the history
  • Loading branch information
nagarev committed Nov 22, 2024
1 parent ff50bce commit e4e7902
Show file tree
Hide file tree
Showing 8 changed files with 664 additions and 8 deletions.
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
comment

// CONTRACT CODE
//

// SPDX-License-Identifier: UNLICENSED
pragma solidity ^0.8.20;

Expand Down Expand Up @@ -68,4 +73,81 @@ contract TestMCopy {

}

}
}

// DESCRIPTION

This contract contains two types of functions:

* checkMCopy runs the tes function and based on its return value:
- Emits an OK event if it returned true.
- Emits an ERROR otherwise.

* testFullMemoryCopy initialize, modifies and checks memory and then:
- Returns true if all the checks passed.
- Returns false otherwise.

// CONTRACT BYTECODE

6080604052348015600e575f80fd5b506103548061001c5f395ff3fe608060405234801561000f575f80fd5b5060043610610034575f3560e01c80638c2bcab914610038578063c0b80c4f14610042575b5f80fd5b610040610060565b005b61004a6100cd565b6040516100579190610305565b60405180910390f35b6100686100cd565b1561009e577fd48fe2800bace8f5ca2450feacbd6efc681b1cd0115019bb49fa529b6171bf6760405160405180910390a16100cb565b7f1c9c433b57013295d61f5c5738f5e2cb1de70bb5ba5b2896edfa8efae345965e60405160405180910390a15b565b5f807e0102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f5f1b90505f7f202122232425262728292a2b2c2d2e2f303132333435363738393a3b3c3d3e3f5f1b90505f7f404142434445464748494a4b4c4d4e4f505152535455565758595a5b5c5d5e5f5f1b90505f7f606162636465666768696a6b6c6d6e6f707172737475767778797a7b7c7d7e7f5f1b90505f7f808182838485868788898a8b8c8d8e8f909192939495969798999a9b9c9d9e9f5f1b90505f7fa0a1a2a3a4a5a6a7a8a9aaabacadaeafb0b1b2b3b4b5b6b7b8b9babbbcbdbebf5f1b90505f7fc0c1c2c3c4c5c6c7c8c9cacbcccdcecfd0d1d2d3d4d5d6d7d8d9dadbdcdddedf5f1b90505f7fe0e1e2e3e4e5e6e7e8e9eaebecedeeeff0f1f2f3f4f5f6f7f8f9fafbfcfdfeff5f1b90505f80895f52886020528760405286606052856080528460a0528360c0528260e0525991506101005f6101005e599050895f51149a5088602051148b169a5087604051148b169a5086606051148b169a5085608051148b169a508460a051148b169a508360c051148b169a508260e051148b169a508961010051148b169a508861012051148b169a508761014051148b169a508661016051148b169a508561018051148b169a50846101a051148b169a50836101c051148b169a50826101e051148b169a508a80156102cf575061010082145b80156102dc575061020081145b9a505050505050505050505090565b5f8115159050919050565b6102ff816102eb565b82525050565b5f6020820190506103185f8301846102f6565b9291505056fea26469706673582212206300c7f37f94930d3bc96bba8b03c281abe4667f5dc4b92938d6479b051a62cb64736f6c634300081a0033

// CONTRACT CALL

- checkMCopy()

8c2bcab9

end

# Create and fund new account
account_new acc1 10000000

# Create transaction to deploy TestMCopy contract
transaction_build txTestMCopy
sender acc1
receiverAddress 00
value 0
data 6080604052348015600e575f80fd5b506103548061001c5f395ff3fe608060405234801561000f575f80fd5b5060043610610034575f3560e01c80638c2bcab914610038578063c0b80c4f14610042575b5f80fd5b610040610060565b005b61004a6100cd565b6040516100579190610305565b60405180910390f35b6100686100cd565b1561009e577fd48fe2800bace8f5ca2450feacbd6efc681b1cd0115019bb49fa529b6171bf6760405160405180910390a16100cb565b7f1c9c433b57013295d61f5c5738f5e2cb1de70bb5ba5b2896edfa8efae345965e60405160405180910390a15b565b5f807e0102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f5f1b90505f7f202122232425262728292a2b2c2d2e2f303132333435363738393a3b3c3d3e3f5f1b90505f7f404142434445464748494a4b4c4d4e4f505152535455565758595a5b5c5d5e5f5f1b90505f7f606162636465666768696a6b6c6d6e6f707172737475767778797a7b7c7d7e7f5f1b90505f7f808182838485868788898a8b8c8d8e8f909192939495969798999a9b9c9d9e9f5f1b90505f7fa0a1a2a3a4a5a6a7a8a9aaabacadaeafb0b1b2b3b4b5b6b7b8b9babbbcbdbebf5f1b90505f7fc0c1c2c3c4c5c6c7c8c9cacbcccdcecfd0d1d2d3d4d5d6d7d8d9dadbdcdddedf5f1b90505f7fe0e1e2e3e4e5e6e7e8e9eaebecedeeeff0f1f2f3f4f5f6f7f8f9fafbfcfdfeff5f1b90505f80895f52886020528760405286606052856080528460a0528360c0528260e0525991506101005f6101005e599050895f51149a5088602051148b169a5087604051148b169a5086606051148b169a5085608051148b169a508460a051148b169a508360c051148b169a508260e051148b169a508961010051148b169a508861012051148b169a508761014051148b169a508661016051148b169a508561018051148b169a50846101a051148b169a50836101c051148b169a50826101e051148b169a508a80156102cf575061010082145b80156102dc575061020081145b9a505050505050505050505090565b5f8115159050919050565b6102ff816102eb565b82525050565b5f6020820190506103185f8301846102f6565b9291505056fea26469706673582212206300c7f37f94930d3bc96bba8b03c281abe4667f5dc4b92938d6479b051a62cb64736f6c634300081a0033
gas 1200000
build

# Create block to hold txTestMCopy transaction
block_build b01
parent g00
transactions txTestMCopy
build

# Connect block
block_connect b01

# Check b01 is best block
assert_best b01

# Check txTestMCopy succeeded
assert_tx_success txTestMCopy

# Create transaction to execute checkMCopy() method
transaction_build txTestMCopyOKCall
sender acc1
nonce 1
contract txTestMCopy
value 0
data 8c2bcab9
gas 300000
build

# Create block to hold txTestMCopyOKCall transaction
block_build b02
parent b01
transactions txTestMCopyOKCall
gasLimit 6500000
build

# Connect block
block_connect b02

# Check b02 is best block
assert_best b02

# Check txTestMCopyOKCall succeeded
assert_tx_success txTestMCopyOKCall
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
comment

// CONTRACT CODE
//

// SPDX-License-Identifier: UNLICENSED
pragma solidity ^0.8.20;

Expand Down Expand Up @@ -79,4 +84,81 @@ contract TestMCopy {

}

}
}

// DESCRIPTION

This contract contains two types of functions:

* checkMCopy runs the tes function and based on its return value:
- Emits an OK event if it returned true.
- Emits an ERROR otherwise.

* testFullMemoryCopyOffset initialize, modifies and checks memory and then:
- Returns true if all the checks passed.
- Returns false otherwise.

// CONTRACT BYTECODE

6080604052348015600e575f80fd5b506103ab8061001c5f395ff3fe608060405234801561000f575f80fd5b5060043610610034575f3560e01c8063555ef883146100385780638c2bcab914610056575b5f80fd5b610040610060565b60405161004d919061035c565b60405180910390f35b61005e6102d5565b005b5f807e0102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f5f1b90505f7f202122232425262728292a2b2c2d2e2f303132333435363738393a3b3c3d3e3f5f1b90505f7f404142434445464748494a4b4c4d4e4f505152535455565758595a5b5c5d5e5f5f1b90505f7f606162636465666768696a6b6c6d6e6f707172737475767778797a7b7c7d7e7f5f1b90505f7f808182838485868788898a8b8c8d8e8f909192939495969798999a9b9c9d9e9f5f1b90505f7fa0a1a2a3a4a5a6a7a8a9aaabacadaeafb0b1b2b3b4b5b6b7b8b9babbbcbdbebf5f1b90505f7fc0c1c2c3c4c5c6c7c8c9cacbcccdcecfd0d1d2d3d4d5d6d7d8d9dadbdcdddedf5f1b90505f7fe0e1e2e3e4e5e6e7e8e9eaebecedeeeff0f1f2f3f4f5f6f7f8f9fafbfcfdfeff5f1b90505f805f1b90505f808a5f52896020528860405287606052866080528560a0528460c0528360e0525991506101005f6102005e5990508a5f51149b5089602051148c169b5088604051148c169b5087606051148c169b5086608051148c169b508560a051148c169b508460c051148c169b508360e051148c169b508261010051148c169b508261012051148c169b508261014051148c169b508261016051148c169b508261018051148c169b50826101a051148c169b50826101c051148c169b50826101e051148c169b508a61020051148c169b508961022051148c169b508861024051148c169b508761026051148c169b508661028051148c169b50856102a051148c169b50846102c051148c169b50836102e051148c169b508b80156102b8575061010082145b80156102c5575061030081145b9b50505050505050505050505090565b6102dd610060565b15610313577fd48fe2800bace8f5ca2450feacbd6efc681b1cd0115019bb49fa529b6171bf6760405160405180910390a1610340565b7f1c9c433b57013295d61f5c5738f5e2cb1de70bb5ba5b2896edfa8efae345965e60405160405180910390a15b565b5f8115159050919050565b61035681610342565b82525050565b5f60208201905061036f5f83018461034d565b9291505056fea2646970667358221220c4e94d0d017a821439be881bd7ae577b35556e64a80392c127a557d02e3656eb64736f6c634300081a0033

// CONTRACT CALL

- checkMCopy()

8c2bcab9

end

# Create and fund new account
account_new acc1 10000000

# Create transaction to deploy TestMCopy contract
transaction_build txTestMCopy
sender acc1
receiverAddress 00
value 0
data 6080604052348015600e575f80fd5b506103ab8061001c5f395ff3fe608060405234801561000f575f80fd5b5060043610610034575f3560e01c8063555ef883146100385780638c2bcab914610056575b5f80fd5b610040610060565b60405161004d919061035c565b60405180910390f35b61005e6102d5565b005b5f807e0102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f5f1b90505f7f202122232425262728292a2b2c2d2e2f303132333435363738393a3b3c3d3e3f5f1b90505f7f404142434445464748494a4b4c4d4e4f505152535455565758595a5b5c5d5e5f5f1b90505f7f606162636465666768696a6b6c6d6e6f707172737475767778797a7b7c7d7e7f5f1b90505f7f808182838485868788898a8b8c8d8e8f909192939495969798999a9b9c9d9e9f5f1b90505f7fa0a1a2a3a4a5a6a7a8a9aaabacadaeafb0b1b2b3b4b5b6b7b8b9babbbcbdbebf5f1b90505f7fc0c1c2c3c4c5c6c7c8c9cacbcccdcecfd0d1d2d3d4d5d6d7d8d9dadbdcdddedf5f1b90505f7fe0e1e2e3e4e5e6e7e8e9eaebecedeeeff0f1f2f3f4f5f6f7f8f9fafbfcfdfeff5f1b90505f805f1b90505f808a5f52896020528860405287606052866080528560a0528460c0528360e0525991506101005f6102005e5990508a5f51149b5089602051148c169b5088604051148c169b5087606051148c169b5086608051148c169b508560a051148c169b508460c051148c169b508360e051148c169b508261010051148c169b508261012051148c169b508261014051148c169b508261016051148c169b508261018051148c169b50826101a051148c169b50826101c051148c169b50826101e051148c169b508a61020051148c169b508961022051148c169b508861024051148c169b508761026051148c169b508661028051148c169b50856102a051148c169b50846102c051148c169b50836102e051148c169b508b80156102b8575061010082145b80156102c5575061030081145b9b50505050505050505050505090565b6102dd610060565b15610313577fd48fe2800bace8f5ca2450feacbd6efc681b1cd0115019bb49fa529b6171bf6760405160405180910390a1610340565b7f1c9c433b57013295d61f5c5738f5e2cb1de70bb5ba5b2896edfa8efae345965e60405160405180910390a15b565b5f8115159050919050565b61035681610342565b82525050565b5f60208201905061036f5f83018461034d565b9291505056fea2646970667358221220c4e94d0d017a821439be881bd7ae577b35556e64a80392c127a557d02e3656eb64736f6c634300081a0033
gas 1200000
build

# Create block to hold txTestMCopy transaction
block_build b01
parent g00
transactions txTestMCopy
build

# Connect block
block_connect b01

# Check b01 is best block
assert_best b01

# Check txTestMCopy succeeded
assert_tx_success txTestMCopy

# Create transaction to execute checkMCopy() method
transaction_build txTestMCopyOKCall
sender acc1
nonce 1
contract txTestMCopy
value 0
data 8c2bcab9
gas 300000
build

# Create block to hold txTestMCopyOKCall transaction
block_build b02
parent b01
transactions txTestMCopyOKCall
gasLimit 6500000
build

# Connect block
block_connect b02

# Check b02 is best block
assert_best b02

# Check txTestMCopyOKCall succeeded
assert_tx_success txTestMCopyOKCall
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
comment

// CONTRACT CODE
//

// SPDX-License-Identifier: UNLICENSED
pragma solidity ^0.8.20;

Expand Down Expand Up @@ -59,4 +64,81 @@ contract TestMCopy {

}

}
}

// DESCRIPTION

This contract contains two types of functions:

* checkMCopy runs the tes function and based on its return value:
- Emits an OK event if it returned true.
- Emits an ERROR otherwise.

* testFullMemoryRewrite initialize, modifies and checks memory and then:
- Returns true if all the checks passed.
- Returns false otherwise.

// CONTRACT BYTECODE

6080604052348015600e575f80fd5b506103028061001c5f395ff3fe608060405234801561000f575f80fd5b5060043610610034575f3560e01c80633a05a424146100385780638c2bcab914610056575b5f80fd5b610040610060565b60405161004d91906102b3565b60405180910390f35b61005e61022c565b005b5f807e0102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f5f1b90505f7f202122232425262728292a2b2c2d2e2f303132333435363738393a3b3c3d3e3f5f1b90505f7f404142434445464748494a4b4c4d4e4f505152535455565758595a5b5c5d5e5f5f1b90505f7f606162636465666768696a6b6c6d6e6f707172737475767778797a7b7c7d7e7f5f1b90505f7f808182838485868788898a8b8c8d8e8f909192939495969798999a9b9c9d9e9f5f1b90505f7fa0a1a2a3a4a5a6a7a8a9aaabacadaeafb0b1b2b3b4b5b6b7b8b9babbbcbdbebf5f1b90505f7fc0c1c2c3c4c5c6c7c8c9cacbcccdcecfd0d1d2d3d4d5d6d7d8d9dadbdcdddedf5f1b90505f7fe0e1e2e3e4e5e6e7e8e9eaebecedeeeff0f1f2f3f4f5f6f7f8f9fafbfcfdfeff5f1b90505f80895f52886020528760405286606052856080528460a0528360c0528260e0525991506101005f805e599050895f51149a5088602051148b169a5087604051148b169a5086606051148b169a5085608051148b169a508460a051148b169a508360c051148b169a508260e051148b169a508a8015610210575061010082145b801561021d575061010081145b9a505050505050505050505090565b610234610060565b1561026a577fd48fe2800bace8f5ca2450feacbd6efc681b1cd0115019bb49fa529b6171bf6760405160405180910390a1610297565b7f1c9c433b57013295d61f5c5738f5e2cb1de70bb5ba5b2896edfa8efae345965e60405160405180910390a15b565b5f8115159050919050565b6102ad81610299565b82525050565b5f6020820190506102c65f8301846102a4565b9291505056fea2646970667358221220403c015d6168a20ce36383a9cbd22e79e8f007dcf460a1a87e6bbff01226f61464736f6c634300081a0033

// CONTRACT CALL

- checkMCopy()

8c2bcab9

end

# Create and fund new account
account_new acc1 10000000

# Create transaction to deploy TestMCopy contract
transaction_build txTestMCopy
sender acc1
receiverAddress 00
value 0
data 6080604052348015600e575f80fd5b506103028061001c5f395ff3fe608060405234801561000f575f80fd5b5060043610610034575f3560e01c80633a05a424146100385780638c2bcab914610056575b5f80fd5b610040610060565b60405161004d91906102b3565b60405180910390f35b61005e61022c565b005b5f807e0102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f5f1b90505f7f202122232425262728292a2b2c2d2e2f303132333435363738393a3b3c3d3e3f5f1b90505f7f404142434445464748494a4b4c4d4e4f505152535455565758595a5b5c5d5e5f5f1b90505f7f606162636465666768696a6b6c6d6e6f707172737475767778797a7b7c7d7e7f5f1b90505f7f808182838485868788898a8b8c8d8e8f909192939495969798999a9b9c9d9e9f5f1b90505f7fa0a1a2a3a4a5a6a7a8a9aaabacadaeafb0b1b2b3b4b5b6b7b8b9babbbcbdbebf5f1b90505f7fc0c1c2c3c4c5c6c7c8c9cacbcccdcecfd0d1d2d3d4d5d6d7d8d9dadbdcdddedf5f1b90505f7fe0e1e2e3e4e5e6e7e8e9eaebecedeeeff0f1f2f3f4f5f6f7f8f9fafbfcfdfeff5f1b90505f80895f52886020528760405286606052856080528460a0528360c0528260e0525991506101005f805e599050895f51149a5088602051148b169a5087604051148b169a5086606051148b169a5085608051148b169a508460a051148b169a508360c051148b169a508260e051148b169a508a8015610210575061010082145b801561021d575061010081145b9a505050505050505050505090565b610234610060565b1561026a577fd48fe2800bace8f5ca2450feacbd6efc681b1cd0115019bb49fa529b6171bf6760405160405180910390a1610297565b7f1c9c433b57013295d61f5c5738f5e2cb1de70bb5ba5b2896edfa8efae345965e60405160405180910390a15b565b5f8115159050919050565b6102ad81610299565b82525050565b5f6020820190506102c65f8301846102a4565b9291505056fea2646970667358221220403c015d6168a20ce36383a9cbd22e79e8f007dcf460a1a87e6bbff01226f61464736f6c634300081a0033
gas 1200000
build

# Create block to hold txTestMCopy transaction
block_build b01
parent g00
transactions txTestMCopy
build

# Connect block
block_connect b01

# Check b01 is best block
assert_best b01

# Check txTestMCopy succeeded
assert_tx_success txTestMCopy

# Create transaction to execute checkMCopy() method
transaction_build txTestMCopyOKCall
sender acc1
nonce 1
contract txTestMCopy
value 0
data 8c2bcab9
gas 300000
build

# Create block to hold txTestMCopyOKCall transaction
block_build b02
parent b01
transactions txTestMCopyOKCall
gasLimit 6500000
build

# Connect block
block_connect b02

# Check b02 is best block
assert_best b02

# Check txTestMCopyOKCall succeeded
assert_tx_success txTestMCopyOKCall
Loading

0 comments on commit e4e7902

Please sign in to comment.