Merge remote-tracking branch 'origin/master' into github_fe

pull/5370/head
yann300 3 months ago
commit e666a91839
  1. 2
      libs/remix-debug/package.json
  2. 23
      libs/remix-debug/test/debugger.ts
  3. 4
      libs/remix-debug/test/decoder/contracts/byteStorage.ts
  4. 2
      libs/remix-debug/test/decoder/contracts/miscContracts.ts
  5. 2
      libs/remix-debug/test/decoder/contracts/miscLocal.ts
  6. 2
      libs/remix-debug/test/decoder/decodeInfo.ts
  7. 12
      libs/remix-debug/test/decoder/localsTests/int.ts
  8. 4
      libs/remix-debug/test/decoder/localsTests/structArray.ts
  9. 7
      libs/remix-debug/test/decoder/stateTests/mapping.ts
  10. 8
      libs/remix-debug/test/sourceLocationTracker.ts
  11. 2
      libs/remix-debug/test/vmCall.ts
  12. 2
      libs/remix-lib/package.json
  13. 2
      libs/remix-solidity/package.json
  14. 2
      libs/remix-tests/package.json
  15. 4
      libs/remix-tests/tests/examples_0/assert_greaterThan_test.sol
  16. 8
      libs/remix-tests/tests/examples_0/assert_lesserThan_test.sol
  17. 2
      libs/remix-tests/tests/examples_1/simple_storage.sol
  18. 2
      libs/remix-tests/tests/examples_1/simple_storage_test.sol
  19. 2
      libs/remix-tests/tests/examples_2/simple_storage.sol
  20. 2
      libs/remix-tests/tests/examples_2/simple_storage_test.sol
  21. 2
      libs/remix-tests/tests/examples_3/simple_string.sol
  22. 2
      libs/remix-tests/tests/examples_3/simple_string_test.sol
  23. 2
      libs/remix-tests/tests/examples_4/SafeMath.sol
  24. 2
      libs/remix-tests/tests/examples_4/SafeMathProxy.sol
  25. 48
      libs/remix-tests/tests/examples_4/SafeMath_test.sol
  26. 2
      libs/remix-tests/tests/examples_5/contract/simple_storage.sol
  27. 2
      libs/remix-tests/tests/examples_5/lib/EvenOdd.sol
  28. 2
      libs/remix-tests/tests/examples_5/test/simple_storage_test.sol
  29. 2
      libs/remix-tests/tests/number/number_test.sol
  30. 21
      libs/remix-tests/tests/testRunner.spec.ts
  31. 2
      package.json
  32. 17
      yarn.lock

@ -52,7 +52,7 @@
"@babel/preset-stage-0": "^7.0.0",
"babel-eslint": "^7.1.1",
"babelify": "^10.0.0",
"solc": "^0.7.4",
"solc": "0.8.26",
"tape": "^4.6.0"
},
"publishConfig": {

@ -214,11 +214,12 @@ function testDebugging (debugManager) {
try {
const callstack = debugManager.traceManager.getStackAt(41)
t.equal(JSON.stringify(callstack), JSON.stringify([
'0x0000000000000000000000000000000000000000000000000000000000000080',
'0x0000000000000000000000000000000000000000000000000000000000000020',
'0x0000000000000000000000000000000000000000000000000000000000000318',
'0x0000000000000000000000000000000000000000000000000000000000000001',
'0x0000000000000000000000000000000000000000000000000000000000000000',
'0x0000000000000000000000000000000000000000000000000000000000000080',
'0x00000000000000000000000000000000000000000000000000000000000000e0',
'0x00000000000000000000000000000000000000000000000000000000000000e0']))
'0x0000000000000000000000000000000000000000000000000000000000000031']))
} catch (error) {
return t.end(error)
}
@ -231,7 +232,7 @@ function testDebugging (debugManager) {
try {
const address = debugManager.traceManager.getCurrentCalledAddressAt(38)
console.log(address)
const storageView = debugManager.storageViewAt(196, address)
const storageView = debugManager.storageViewAt(356, address)
storageView.storageRange().then((storage) => {
t.equal(JSON.stringify(storage), JSON.stringify({ '0x290decd9548b62a8d60345a988386fc84ba6bc95484008f6362f93160ef3e563': { key: '0x0000000000000000000000000000000000000000000000000000000000000000', value: '0x0000000000000000000000005b38da6a701c568545dcfcb03fcb875f56beddc4' } }))
@ -246,8 +247,8 @@ function testDebugging (debugManager) {
tape('traceManager.decodeStateAt', async (t) => {
t.plan(7)
try {
const state = await debugManager.extractStateAt(312)
const decodedState = await debugManager.decodeStateAt(312, state)
const state = await debugManager.extractStateAt(442)
const decodedState = await debugManager.decodeStateAt(442, state)
console.log(decodedState)
t.equal(decodedState['chairperson'].value, '0x5B38DA6A701C568545DCFCB03FCB875F56BEDDC4')
t.equal(decodedState['chairperson'].type, 'address')
@ -265,9 +266,9 @@ function testDebugging (debugManager) {
t.plan(1)
const tested = JSON.parse('{"proposalNames":{"value":[{"value":"0x48656C6C6F20576F726C64210000000000000000000000000000000000000000","type":"bytes32"}],"length":"0x1","type":"bytes32[]","cursor":1,"hasNext":false},"p":{"value":"45","type":"uint256"},"addressLocal":{"value":"0x5B38DA6A701C568545DCFCB03FCB875F56BEDDC4","type":"address"},"i":{"value":"2","type":"uint256"},"proposalsLocals":{"value":[{"value":{"name":{"value":"0x48656C6C6F20576F726C64210000000000000000000000000000000000000000","type":"bytes32"},"voteCount":{"value":"0","type":"uint256"}},"type":"struct Ballot.Proposal"}],"length":"0x1","type":"struct Ballot.Proposal[]"}}')
try {
const address = debugManager.traceManager.getCurrentCalledAddressAt(327)
const location = await debugManager.sourceLocationFromVMTraceIndex(address, 327)
debugManager.decodeLocalsAt(327, location, (error, decodedlocals) => {
const address = debugManager.traceManager.getCurrentCalledAddressAt(487)
const location = await debugManager.sourceLocationFromVMTraceIndex(address, 487)
debugManager.decodeLocalsAt(487, location, (error, decodedlocals) => {
if (error) return t.end(error)
const res = deepequal(decodedlocals, tested)
t.ok(res, `test if locals does match. expected: ${JSON.stringify(tested)} - current: ${JSON.stringify(decodedlocals)}`)
@ -285,8 +286,8 @@ function testDebugging (debugManager) {
breakPointManager.add({ fileName: 'test.sol', row: 39 })
breakPointManager.event.register('breakpointHit', function (sourceLocation, step) {
t.equal(JSON.stringify(sourceLocation), JSON.stringify({ start: 1146, length: 6, file: 0, jump: '-' }))
t.equal(step, 212)
t.equal(JSON.stringify(sourceLocation), JSON.stringify({ start: 1146, length: 6, jump: '-', file: 0 }))
t.equal(step, 372)
})
breakPointManager.event.register('noBreakpointHit', function () {

@ -3,13 +3,13 @@
module.exports = {
contract: `
contract byteStorage {
enum enum1 { e0, e1, e2, e3, e4, e5, e6, e7, e8, e9, e10, e11, e12, e13, e14, e15, e16, e17, e18, e19, e20, e21, e22, e23, e24, e25, e26, e27, e28, e29, e30, e31, e32, e33, e34, e35, e36, e37, e38, e39, e40, e41, e42, e43, e44, e45, e46, e47, e48, e49, e50, e51, e52, e53, e54, e55, e56, e57, e58, e59, e60, e61, e62, e63, e64, e65, e66, e67, e68, e69, e70, e71, e72, e73, e74, e75, e76, e77, e78, e79, e80, e81, e82, e83, e84, e85, e86, e87, e88, e89, e90, e91, e92, e93, e94, e95, e96, e97, e98, e99, e100, e101, e102, e103, e104, e105, e106, e107, e108, e109, e110, e111, e112, e113, e114, e115, e116, e117, e118, e119, e120, e121, e122, e123, e124, e125, e126, e127, e128, e129, e130, e131, e132, e133, e134, e135, e136, e137, e138, e139, e140, e141, e142, e143, e144, e145, e146, e147, e148, e149, e150, e151, e152, e153, e154, e155, e156, e157, e158, e159, e160, e161, e162, e163, e164, e165, e166, e167, e168, e169, e170, e171, e172, e173, e174, e175, e176, e177, e178, e179, e180, e181, e182, e183, e184, e185, e186, e187, e188, e189, e190, e191, e192, e193, e194, e195, e196, e197, e198, e199, e200, e201, e202, e203, e204, e205, e206, e207, e208, e209, e210, e211, e212, e213, e214, e215, e216, e217, e218, e219, e220, e221, e222, e223, e224, e225, e226, e227, e228, e229, e230, e231, e232, e233, e234, e235, e236, e237, e238, e239, e240, e241, e242, e243, e244, e245, e246, e247, e248, e249, e250, e251, e252, e253, e254, e255, e256, e257, e258, e259, e260 }
enum enum1 { e0, e1, e2, e3, e4, e5, e6, e7, e8, e9, e10, e11, e12, e13, e14, e15, e16, e17, e18, e19, e20, e21, e22, e23, e24, e25, e26, e27, e28, e29, e30, e31, e32, e33, e34, e35, e36, e37, e38, e39, e40, e41, e42, e43, e44, e45, e46, e47, e48, e49, e50, e51, e52, e53, e54, e55, e56, e57, e58, e59, e60, e61, e62, e63, e64, e65, e66, e67, e68, e69, e70, e71, e72, e73, e74, e75, e76, e77, e78, e79, e80, e81, e82, e83, e84, e85, e86, e87, e88, e89, e90, e91, e92, e93, e94, e95, e96, e97, e98, e99, e100, e101, e102, e103, e104, e105, e106, e107, e108, e109, e110, e111, e112, e113, e114, e115, e116, e117, e118, e119, e120, e121, e122, e123, e124, e125, e126, e127, e128, e129, e130, e131, e132, e133, e134, e135, e136, e137, e138, e139, e140, e141, e142, e143, e144, e145, e146, e147, e148, e149, e150, e151, e152, e153, e154, e155, e156, e157, e158, e159, e160, e161, e162, e163, e164, e165, e166, e167, e168, e169, e170, e171, e172, e173, e174, e175, e176, e177, e178, e179, e180, e181, e182, e183, e184, e185, e186, e187, e188, e189, e190, e191, e192, e193, e194, e195, e196, e197, e198, e199, e200, e201, e202, e203, e204, e205, e206, e207, e208, e209, e210, e211, e212, e213, e214, e215, e216, e217, e218, e219, e220, e221, e222, e223, e224, e225, e226, e227, e228, e229, e230, e231, e232, e233, e234, e235, e236, e237, e238, e239, e240, e241, e242, e243, e244, e245, e246, e247, e248, e249, e250, e251, e252, e253, e254, e255 }
bool b1 = false;
address a1 = 0xfE350f199F244ac9A79038d254400b632a633225;
bool b2 = true;
bytes dynb1 = "dynamicbytes";
byte stab = 0x01;
bytes1 stab = 0x01;
bytes1 stab1 = hex"12";
bytes2 stab2 = hex"1579";
bytes3 stab3 = hex"359356";

@ -27,7 +27,7 @@ module.exports = `
}
contract contractEnum {
enum enumDef {item0,item1,item2,item3,item4,item5,item6,item7,item8,item9,item10,item11,item12,item13,item14,item15,item16,item17,item18,item19,item20,item21,item22,item23,item24,item25,item26,item27,item28,item29,item30,item31,item32,item33,item34,item35,item36,item37,item38,item39,item40,item41,item42,item43,item44,item45,item46,item47,item48,item49,item50,item51,item52,item53,item54,item55,item56,item57,item58,item59,item60,item61,item62,item63,item64,item65,item66,item67,item68,item69,item70,item71,item72,item73,item74,item75,item76,item77,item78,item79,item80,item81,item82,item83,item84,item85,item86,item87,item88,item89,item90,item91,item92,item93,item94,item95,item96,item97,item98,item99,item100,item101,item102,item103,item104,item105,item106,item107,item108,item109,item110,item111,item112,item113,item114,item115,item116,item117,item118,item119,item120,item121,item122,item123,item124,item125,item126,item127,item128,item129,item130,item131,item132,item133,item134,item135,item136,item137,item138,item139,item140,item141,item142,item143,item144,item145,item146,item147,item148,item149,item150,item151,item152,item153,item154,item155,item156,item157,item158,item159,item160,item161,item162,item163,item164,item165,item166,item167,item168,item169,item170,item171,item172,item173,item174,item175,item176,item177,item178,item179,item180,item181,item182,item183,item184,item185,item186,item187,item188,item189,item190,item191,item192,item193,item194,item195,item196,item197,item198,item199,item200,item201,item202,item203,item204,item205,item206,item207,item208,item209,item210,item211,item212,item213,item214,item215,item216,item217,item218,item219,item220,item221,item222,item223,item224,item225,item226,item227,item228,item229,item230,item231,item232,item233,item234,item235,item236,item237,item238,item239,item240,item241,item242,item243,item244,item245,item246,item247,item248,item249,item250,item251,item252,item253,item254,item255,item256,item257,item258,item259,item260,item261,item262,item263,item264,item265,item266,item267,item268,item269,item270,item271,item272,item273,item274,item275,item276,item277,item278,item279,item280,item281,item282,item283,item284,item285,item286,item287,item288,item289,item290,item291,item292,item293,item294,item295,item296,item297,item298,item299,item100000000}
enum enumDef {item0,item1,item2,item3,item4,item5,item6,item7,item8,item9,item10,item11,item12,item13,item14,item15,item16,item17,item18,item19,item20,item21,item22,item23,item24,item25,item26,item27,item28,item29,item30,item31,item32,item33,item34,item35,item36,item37,item38,item39,item40,item41,item42,item43,item44,item45,item46,item47,item48,item49,item50,item51,item52,item53,item54,item55,item56,item57,item58,item59,item60,item61,item62,item63,item64,item65,item66,item67,item68,item69,item70,item71,item72,item73,item74,item75,item76,item77,item78,item79,item80,item81,item82,item83,item84,item85,item86,item87,item88,item89,item90,item91,item92,item93,item94,item95,item96,item97,item98,item99,item100,item101,item102,item103,item104,item105,item106,item107,item108,item109,item110,item111,item112,item113,item114,item115,item116,item117,item118,item119,item120,item121,item122,item123,item124,item125,item126,item127,item128,item129,item130,item131,item132,item133,item134,item135,item136,item137,item138,item139,item140,item141,item142,item143,item144,item145,item146,item147,item148,item149,item150,item151,item152,item153,item154,item155,item156,item157,item158,item159,item160,item161,item162,item163,item164,item165,item166,item167,item168,item169,item170,item171,item172,item173,item174,item175,item176,item177,item178,item179,item180,item181,item182,item183,item184,item185,item186,item187,item188,item189,item190,item191,item192,item193,item194,item195,item196,item197,item198,item199,item200,item201,item202,item203,item204,item205,item206,item207,item208,item209,item210,item211,item212,item213,item214,item215,item216,item217,item218,item219,item220,item221,item222,item223,item224,item225,item226,item227,item228,item229,item230,item231,item232,item233,item234,item235,item236,item237,item238,item239,item240,item241,item242,item243,item244,item245,item246,item247,item248,item249,item250,item251,item252,item253,item254,item255}
enumDef enum1;
}

@ -15,7 +15,7 @@ contract miscLocal {
enumDef testEnum;
testEnum = enumDef.three;
address sender = msg.sender;
byte _bytes1 = hex"99";
bytes1 _bytes1 = hex"99";
bytes1 __bytes1 = hex"99";
bytes2 __bytes2 = hex"99AB";
bytes4 __bytes4 = hex"99FA";

@ -47,7 +47,7 @@ tape('solidity', function (t) {
state = astHelper.extractStateDefinitions('test.sol:contractEnum', output.sources, null)
stateDef = state.stateDefinitions
parsedType = decodeInfo.parseType(stateDef[1].typeDescriptions.typeString, states, 'contractEnum', null)
checkDecodeInfo(st, parsedType, 1, 2, 'enum')
checkDecodeInfo(st, parsedType, 1, 1, 'enum')
state = astHelper.extractStateDefinitions('test.sol:contractSmallVariable', output.sources, null)
stateDef = state.stateDefinitions

@ -49,7 +49,7 @@ module.exports = function (st, privateKey, contractBytecode, compilationResult,
try {
// test gas cost per line
st.equals((await callTree.getGasCostPerLine(0, 16)).gasCost, 11)
st.equals((await callTree.getGasCostPerLine(0, 16)).gasCost, 10)
st.equals((await callTree.getGasCostPerLine(0, 32)).gasCost, 84)
const functions1 = callTree.retrieveFunctionsStack(103)
@ -60,12 +60,12 @@ module.exports = function (st, privateKey, contractBytecode, compilationResult,
st.equals(functions2.length, 3)
st.equals(functions3.length, 1)
st.equal(functions1[0].gasCost, 54)
st.equal(functions1[1].gasCost, 436)
st.equal(functions1[0].gasCost, 53)
st.equal(functions1[1].gasCost, 423)
st.equal(functions2[0].gasCost, 23)
st.equal(functions2[1].gasCost, 54)
st.equal(functions2[2].gasCost, 436)
st.equal(functions2[0].gasCost, 22)
st.equal(functions2[1].gasCost, 53)
st.equal(functions2[2].gasCost, 423)
st.equals(Object.keys(functions1[0])[0], 'functionDefinition')
st.equals(Object.keys(functions1[0])[1], 'inputs')

@ -42,9 +42,9 @@ module.exports = function (st, privateKey, contractBytecode, compilationResult,c
st.fail(error)
})
callTree.event.register('callTreeReady', (scopes, scopeStarts) => {
helper.decodeLocals(st, 1622, traceManager, callTree, function (locals) {
helper.decodeLocals(st, 1615, traceManager, callTree, function (locals) {
try {
console.log('at 1622', locals)
console.log('at 1600', locals)
st.equals(locals['bytesSimple'].length, '0x14')
st.equals(locals['bytesSimple'].value, '0x746573745f7375706572')
st.equals(locals['e'].value['a'].value, 'test')

@ -29,11 +29,12 @@ module.exports = async function testMappingStorage (st, cb) {
st.end(error)
} else {
web3.eth.getTransactionReceipt(hash)
.then(tx =>
.then(tx => {
// const storage = await this.vm.stateManager.dumpStorage(data.to)
// (vmCall as any).web3().eth.getCode(tx.contractAddress).then((code) => console.log('code:', code))
// web3.eth.getCode(tx.contractAddress).then((code) => console.log('code:---', code))
// (vmCall as any).web3().debug.traceTransaction(hash).then((code) => console.log('trace:', code))
testMapping(st, privateKey, tx.contractAddress, output, compilationResults, web3, cb)
}
// st.end()
)
.catch(error => {
@ -71,7 +72,7 @@ function testMapping (st, privateKey, contractAddress, output, compilationResult
})
callTree.event.register('callTreeReady', (scopes, scopeStarts) => {
const storageViewer = new StorageViewer({
stepIndex: 268,
stepIndex: 472,
tx: tx,
address: contractAddress
}, new StorageResolver({ web3 }), traceManager)

@ -66,12 +66,12 @@ tape('SourceLocationTracker', function (t) {
map = await sourceLocationTracker.getSourceLocationFromVMTraceIndex('0x0d3a18d64dfe4f927832ab58d6451cecc4e517c5', 45, output.contracts)
st.equal(map['file'], 1) // 1 refers to the generated source (pragma experimental ABIEncoderV2)
map = await sourceLocationTracker.getValidSourceLocationFromVMTraceIndex('0x0d3a18d64dfe4f927832ab58d6451cecc4e517c5', 45, output.contracts)
map = await sourceLocationTracker.getValidSourceLocationFromVMTraceIndex('0x0d3a18d64dfe4f927832ab58d6451cecc4e517c5', 30, output.contracts)
st.equal(map['file'], 0) // 1 refers to the generated source (pragma experimental ABIEncoderV2)
st.equal(map['start'], 303)
st.equal(map['length'], 448)
map = await sourceLocationTracker.getValidSourceLocationFromVMTraceIndex('0x0d3a18d64dfe4f927832ab58d6451cecc4e517c5', 36, output.contracts)
map = await sourceLocationTracker.getValidSourceLocationFromVMTraceIndex('0x0d3a18d64dfe4f927832ab58d6451cecc4e517c5', 26, output.contracts)
st.equal(map['file'], 0) // 0 refers to the initial solidity code. see source below (ABIEncoderV2)
st.equal(map['start'], 303)
st.equal(map['length'], 448)
@ -93,8 +93,8 @@ tape('SourceLocationTracker', function (t) {
map = await sourceLocationTracker.getValidSourceLocationFromVMTraceIndex('0x0d3a18d64dfe4f927832ab58d6451cecc4e517c5', 45, output.contracts)
st.equal(map['file'], 1) // 1 refers to the generated source (pragma experimental ABIEncoderV2)
st.equal(map['start'], 1297)
st.equal(map['length'], 32)
st.equal(map['start'], 2085)
st.equal(map['length'], 139)
map = await sourceLocationTracker.getValidSourceLocationFromVMTraceIndex('0x0d3a18d64dfe4f927832ab58d6451cecc4e517c5', 36, output.contracts)
st.equal(map['file'], 0) // 0 refers to the initial solidity code. see source below (ABIEncoderV2)

@ -5,7 +5,7 @@ import { Web3 } from 'web3';
const { Provider } = require('@remix-project/remix-simulator')
async function getWeb3 () {
const remixSimulatorProvider = new Provider({ fork: 'berlin' })
const remixSimulatorProvider = new Provider({ fork: 'cancun' })
await remixSimulatorProvider.init()
await remixSimulatorProvider.Accounts.resetAccounts()
const web3 = new Web3(remixSimulatorProvider)

@ -25,7 +25,7 @@
"events": "^3.0.0",
"from-exponential": "1.1.1",
"rlp": "^3.0.0",
"solc": "^0.7.4",
"solc": "0.8.26",
"string-similarity": "^4.0.4",
"web3": "^4.1.1",
"web3-validator": "^2.0.0"

@ -26,7 +26,7 @@
"ethjs-util": "^0.1.6",
"minixhr": "^3.2.2",
"semver": "^6.3.0",
"solc": "^0.7.4",
"solc": "0.8.26",
"string-similarity": "^4.0.4",
"web3": "^4.1.1",
"webworkify-webpack": "^2.1.5"

@ -58,7 +58,7 @@
"express-ws": "^4.0.0",
"merge": "^1.2.0",
"signale": "^1.4.0",
"solc": "^0.7.4",
"solc": "0.8.26",
"string-similarity": "^4.0.4",
"time-stamp": "^2.2.0",
"tslib": "^2.3.0",

@ -29,8 +29,4 @@ contract AssertGreaterThanTest {
function greaterThanIntUintPassTest() public {
Assert.greaterThan(int(10), uint(2), "greaterThanIntUintPassTest passes");
}
function greaterThanIntUintFailTest() public {
Assert.greaterThan(int(100), uint(-100), "greaterThanIntUintFailTest fails");
}
}

@ -22,14 +22,6 @@ contract AssertLesserThanTest {
Assert.lesserThan(uint(1), int(2), "lesserThanUintIntPassTest passes");
}
function lesserThanUintIntFailTest() public {
Assert.lesserThan(uint(-1), int(-1), "lesserThanUintIntFailTest fails");
}
function lesserThanIntUintPassTest() public {
Assert.lesserThan(int(100), uint(-50), "lesserThanIntUintPassTest passes");
}
function lesserThanIntUintFailTest() public {
Assert.lesserThan(int(1), uint(1), "lesserThanIntUintFailTest fails");
}

@ -1,4 +1,4 @@
pragma solidity >= 0.5.0 < 0.8.0;
pragma solidity >= 0.5.0 < 0.9.0;
contract SimpleStorage {
uint public storedData;

@ -1,4 +1,4 @@
pragma solidity >= 0.5.0 < 0.8.0;
pragma solidity >= 0.5.0 < 0.9.0;
import "./simple_storage.sol";
contract MyTest {

@ -1,4 +1,4 @@
pragma solidity >= 0.5.0 < 0.8.0;
pragma solidity >= 0.5.0 < 0.9.0;
contract SimpleStorage {
uint public storedData;

@ -1,4 +1,4 @@
pragma solidity >= 0.5.0 < 0.8.0;
pragma solidity >= 0.5.0 < 0.9.0;
import "./simple_storage.sol";
contract MyTest {

@ -1,4 +1,4 @@
pragma solidity >= 0.5.0 < 0.8.0;
pragma solidity >= 0.5.0 < 0.9.0;
contract SimpleString {
string public storedData;

@ -1,4 +1,4 @@
pragma solidity >= 0.5.0 < 0.8.0;
pragma solidity >= 0.5.0 < 0.9.0;
import "./simple_string.sol";
contract StringTest {

@ -1,6 +1,6 @@
// Copyright (c) 2016 Smart Contract Solutions, Inc.
pragma solidity >=0.4.22 <0.8.0;
pragma solidity >=0.4.22 <0.9.0;
/**

@ -1,4 +1,4 @@
pragma solidity >=0.4.22 <0.8.0;
pragma solidity >=0.4.22 <0.9.0;
import "./SafeMath.sol";
/*

@ -1,4 +1,4 @@
pragma solidity >=0.4.22 <0.8.0;
pragma solidity >=0.4.22 <0.9.0;
import "remix_tests.sol";
import "./SafeMath.sol";
import "./SafeMathProxy.sol";
@ -10,15 +10,15 @@ contract SafeMathTest {
safemathproxy = new SafeMathProxy();
}
function unsafeMultiplicationShouldOverflow() public returns (bool) {
uint256 a = 4;
uint256 b = 2 ** 256 - 1;
return Assert.equal(
a * b,
2 ** 256 - 4,
"unsafe multiplication did not overflow"
);
}
// function unsafeMultiplicationShouldOverflow() public returns (bool) {
// uint256 a = 4;
// uint256 b = 2 ** 256 - 1;
// return Assert.equal(
// a * b,
// 2 ** 256 - 4,
// "unsafe multiplication did not overflow"
// );
// }
function safeMultiplicationShouldRevert() public returns (bool) {
uint256 a = 4;
@ -42,15 +42,15 @@ contract SafeMathTest {
);
}
function unsafeSubtractShouldUnderflow() public returns (bool) {
uint256 a = 0;
uint256 b = a - 1;
return Assert.equal(
b,
2 ** 256 - 1,
"unsafe subtraction did not underflow"
);
}
// function unsafeSubtractShouldUnderflow() public returns (bool) {
// uint256 a = 0;
// uint256 b = a - 1;
// return Assert.equal(
// b,
// 2 ** 256 - 1,
// "unsafe subtraction did not underflow"
// );
// }
function safeSubtractShouldRevert() public returns (bool) {
(bool success, bytes memory data) = address(safemathproxy).call{gas:40000, value:0}(abi.encode("subProxy, [0, 1]"));
@ -77,11 +77,11 @@ contract SafeMathTest {
}
}
function unsafeAdditionShouldOverflow() public returns (bool) {
uint256 a = 1;
uint256 b = 2 ** 256 - 1;
return Assert.equal(a + b, 0, "unsafe addition did not overflow");
}
// function unsafeAdditionShouldOverflow() public returns (bool) {
// uint256 a = 1;
// uint256 b = 2 ** 256 - 1;
// return Assert.equal(a + b, 0, "unsafe addition did not overflow");
// }
function safeAdditionShouldRevert() public returns (bool) {
uint256 a = 1;

@ -1,4 +1,4 @@
pragma solidity >= 0.5.0 < 0.8.0;
pragma solidity >= 0.5.0 < 0.9.0;
import "../../examples_4/SafeMath.sol";
import "../lib/EvenOdd.sol";

@ -1,4 +1,4 @@
pragma solidity >= 0.5.0 < 0.8.0;
pragma solidity >= 0.5.0 < 0.9.0;
contract EvenOdd {

@ -1,4 +1,4 @@
pragma solidity >= 0.5.0 < 0.8.0;
pragma solidity >= 0.5.0 < 0.9.0;
import "./../contract/simple_storage.sol";
contract StorageResolveTest {

@ -1,4 +1,4 @@
pragma solidity >= 0.5.0 < 0.8.0;
pragma solidity >= 0.5.0 < 0.9.0;
contract IntegerTest {

@ -230,8 +230,8 @@ describe('testRunner', function () {
assert.equal(results.passingNum, 4)
})
it('should have 4 failing test', () => {
assert.equal(results.failureNum, 4)
it('should have 3 failing test', () => {
assert.equal(results.failureNum, 3)
})
it('should return', () => {
deepEqualExcluding(tests, [
@ -244,7 +244,6 @@ describe('testRunner', function () {
{ type: 'testPass', debugTxHash: '0xf52652ef6020ae091022455df8713d20cb00a35de8bf485e177128a457a50d6c', value: 'Greater than uint int pass test', filename: __dirname + '/examples_0/assert_greaterThan_test.sol', context: 'AssertGreaterThanTest' },
{ type: 'testFailure', debugTxHash: '0x9f826060a0e5a8c0187d5e9ffe83a153080379a1e1fea0b267745eb8bd52fd6f', value: 'Greater than uint int fail test', filename: __dirname + '/examples_0/assert_greaterThan_test.sol', errMsg: 'greaterThanUintIntFailTest fails', context: 'AssertGreaterThanTest', assertMethod: 'greaterThan', location: '845:71:0', expected: '2', returned: '1' },
{ type: 'testPass', debugTxHash: '0x04e1703c75cc4beb4b8c9ddfb79489192423fe745089382cadb1811cbf2d915c', value: 'Greater than int uint pass test', filename: __dirname + '/examples_0/assert_greaterThan_test.sol', context: 'AssertGreaterThanTest' },
{ type: 'testFailure', debugTxHash: '0xbb5c94a5fc46417a4d3c763994da78d4f27c83dbc5545cb0522a39c3c6017432', value: 'Greater than int uint fail test', filename: __dirname + '/examples_0/assert_greaterThan_test.sol', errMsg: 'greaterThanIntUintFailTest fails', context: 'AssertGreaterThanTest', assertMethod: 'greaterThan', location: '1125:76:0', expected: '115792089237316195423570985008687907853269984665640564039457584007913129639836', returned: '100' }
], ['time', 'web3'])
})
})
@ -260,12 +259,12 @@ describe('testRunner', function () {
after(() => { tests = [] })
it('should have 4 passing test', () => {
assert.equal(results.passingNum, 4)
it('should have 3 passing test', () => {
assert.equal(results.passingNum, 3)
})
it('should have 4 failing test', () => {
assert.equal(results.failureNum, 4)
it('should have 3 failing test', () => {
assert.equal(results.failureNum, 3)
})
it('should return', () => {
@ -277,9 +276,7 @@ describe('testRunner', function () {
{ type: 'testPass', debugTxHash: '0x353c9bcf4b61abaf4b6ffaae02f18ea0a7fb38a8c3c7a915939561cdf97f2d72', value: 'Lesser than int pass test', filename: __dirname + '/examples_0/assert_lesserThan_test.sol', context: 'AssertLesserThanTest' },
{ type: 'testFailure', debugTxHash: '0xccab30c5a154c4c2e8ca9a8966b86a55f08188d606c3519a5c29534b4b64fb47', value: 'Lesser than int fail test', filename: __dirname + '/examples_0/assert_lesserThan_test.sol', errMsg: 'lesserThanIntFailTest fails', context: 'AssertLesserThanTest', assertMethod: 'lesserThan', location: '557:65:0', expected: '-1', returned: '1' },
{ type: 'testPass', debugTxHash: '0x8e90fb7f3b8343d037444275cd69d431f75a7fc6b46322c69397373463cee22a', value: 'Lesser than uint int pass test', filename: __dirname + '/examples_0/assert_lesserThan_test.sol', context: 'AssertLesserThanTest' },
{ type: 'testFailure', debugTxHash: '0x5db60fe115958b767f0defe81eeb6322ee18ec8df690abad0d1581175882136b', value: 'Lesser than uint int fail test', filename: __dirname + '/examples_0/assert_lesserThan_test.sol', errMsg: 'lesserThanUintIntFailTest fails', context: 'AssertLesserThanTest', assertMethod: 'lesserThan', location: '826:71:0', expected: '-1', returned: '115792089237316195423570985008687907853269984665640564039457584007913129639935' },
{ type: 'testPass', debugTxHash: '0x19f79e8c8ec360cd27beee6399e6853a4fe335af78364ed35c93f8fe39e3100c', value: 'Lesser than int uint pass test', filename: __dirname + '/examples_0/assert_lesserThan_test.sol', context: 'AssertLesserThanTest' },
{ type: 'testFailure', debugTxHash: '0x520ecba457bf71f42d24f61432d872121da699af0374090e2e9098a6719cb0ce', value: 'Lesser than int uint fail test', filename: __dirname + '/examples_0/assert_lesserThan_test.sol', errMsg: 'lesserThanIntUintFailTest fails', context: 'AssertLesserThanTest', assertMethod: 'lesserThan', location: '1105:69:0', expected: '1', returned: '1' },
{ type: 'testFailure', debugTxHash: '0x7912b2535fe0f5a56b274a7ec5ef6dbb0f52a7199f11831867a98961568f2883', value: 'Lesser than int uint fail test', filename: __dirname + '/examples_0/assert_lesserThan_test.sol', errMsg: 'lesserThanIntUintFailTest fails', context: 'AssertLesserThanTest', assertMethod: 'lesserThan', location: '826:69:0', expected: '1', returned: '1' },
], ['time', 'web3'])
})
})
@ -409,8 +406,8 @@ describe('testRunner', function () {
after(() => { tests = [] })
it('should have 10 passing tests', () => {
assert.equal(results.passingNum, 10)
it('should have 7 passing tests', () => {
assert.equal(results.passingNum, 7)
})
it('should have 0 failing tests', () => {
assert.equal(results.failureNum, 0)

@ -358,7 +358,7 @@
"request": "^2.83.0",
"rimraf": "^2.6.1",
"semver": "^7.4.0",
"solc": "^0.7.4",
"solc": "0.8.26",
"stream-browserify": "^3.0.0",
"stream-http": "^3.2.0",
"style-loader": "^3.3.1",

@ -12400,6 +12400,11 @@ commander@^7.0.0, commander@^7.2.0:
resolved "https://registry.yarnpkg.com/commander/-/commander-7.2.0.tgz#a36cb57d0b501ce108e4d20559a150a391d97ab7"
integrity sha512-QrWXB+ZQSVPmIWIhtEO9H+gwHaMGYiF5ChvoJ+K9ZGHG/sVsa6yiesAD1GC/x46sET00Xlwo1u49RVVVzvcSkw==
commander@^8.1.0:
version "8.3.0"
resolved "https://registry.yarnpkg.com/commander/-/commander-8.3.0.tgz#4837ea1b2da67b9c616a67afbb0fafee567bca66"
integrity sha512-OkTL9umf+He2DZkUq8f8J9of7yL6RJKI24dVITBmNfZBmri9zYZQrKkuXiKhyfPSu8tUhnVBB1iKXevvnlR4Ww==
commander@^9.2.0, commander@^9.4.1:
version "9.4.1"
resolved "https://registry.yarnpkg.com/commander/-/commander-9.4.1.tgz#d1dd8f2ce6faf93147295c0df13c7c21141cfbdd"
@ -28239,18 +28244,16 @@ solc@0.7.3:
semver "^5.5.0"
tmp "0.0.33"
solc@^0.7.4:
version "0.7.6"
resolved "https://registry.yarnpkg.com/solc/-/solc-0.7.6.tgz#21fc5dc11b85fcc518c181578b454f3271c27252"
integrity sha512-WsR/W7CXwh2VnmZapB4JrsDeLlshoKBz5Pz/zYNulB6LBsOEHI2Zj/GeKLMFcvv57OHiXHvxq5ZOQB+EdqxlxQ==
solc@0.8.26:
version "0.8.26"
resolved "https://registry.yarnpkg.com/solc/-/solc-0.8.26.tgz#afc78078953f6ab3e727c338a2fefcd80dd5b01a"
integrity sha512-yiPQNVf5rBFHwN6SIf3TUUvVAFKcQqmSUFeq+fb6pNRCo0ZCgpYOZDi3BVoezCPIAcKrVYd/qXlBLUP9wVrZ9g==
dependencies:
command-exists "^1.2.8"
commander "3.0.2"
commander "^8.1.0"
follow-redirects "^1.12.1"
fs-extra "^0.30.0"
js-sha3 "0.8.0"
memorystream "^0.3.1"
require-from-string "^2.0.0"
semver "^5.5.0"
tmp "0.0.33"

Loading…
Cancel
Save