From 252fd0be22600c1a8b944f972bf837e5f3b0974e Mon Sep 17 00:00:00 2001 From: Thomas Haller Date: Sat, 23 Nov 2024 12:06:15 +0100 Subject: [PATCH 1/3] remove registrar from template --- templates/spec_hbbft.json | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/templates/spec_hbbft.json b/templates/spec_hbbft.json index 30dbe24..b48c71c 100644 --- a/templates/spec_hbbft.json +++ b/templates/spec_hbbft.json @@ -26,8 +26,7 @@ "eip1344Transition": "0x0", "eip1706Transition": "0x0", "eip1884Transition": "0x0", - "eip2028Transition": "0x0", - "registrar": "0x6000000000000000000000000000000000000000" + "eip2028Transition": "0x0" }, "genesis": { "seal": { From 73bd37598001724c184b5227c3000012d0d3f0ab Mon Sep 17 00:00:00 2001 From: Thomas Haller Date: Sat, 23 Nov 2024 12:06:24 +0100 Subject: [PATCH 2/3] removed unused templates --- templates/artis_tau1.json | 163 ----------------------------------- templates/spec.json | 174 -------------------------------------- 2 files changed, 337 deletions(-) delete mode 100644 templates/artis_tau1.json delete mode 100644 templates/spec.json diff --git a/templates/artis_tau1.json b/templates/artis_tau1.json deleted file mode 100644 index 2f3adeb..0000000 --- a/templates/artis_tau1.json +++ /dev/null @@ -1,163 +0,0 @@ -{ - "name": "tau1.artis", - "nodes": [ - "enode://65ef6f4a59fcbbd0567de0671588ab03e6d0628005f5b514af3295736a76f3ea30b5ecde8e64a5cc0aa20bfa8c5b7bb425470b8e9c9e6b05b34892f2a7f7ec15@94.130.160.202:30303", - "enode://467d712458c03f6ab5a243a297efbb48e1829b09145ee047ebb9be09e3d72e3149e927291ca1a9a302a855e39f3ae699531bad0b7cdb5f950eb55812caeeb21e@95.216.175.113:30303" - ], - "engine": { - "authorityRound": { - "params": { - "stepDuration": 5, - "maximumUncleCountTransition": 0, - "maximumUncleCount": 0, - "validators": { - "multi": { - "0": { - "safeContract": "0xAAA0000000000000000000000000000000000AAA" - } - } - }, - "blockReward": "0", - "blockRewardContractTransitions": { - "1000": "0x9ebf6cc90ccc648f939a78071cca7c53833bdb87" - } - } - } - }, - "params": { - "gasLimitBoundDivisor": "0x400", - "maximumExtraDataSize": "0x20", - "minGasLimit": "0x1388", - "networkID": "0x03C401", - - "eip140Transition": "0x0", - "eip211Transition": "0x0", - "eip214Transition": "0x0", - "eip658Transition": "0x0", - "eip145Transition": "0x0", - "eip1014Transition": "0x0", - "eip1052Transition": "0x0", - "eip1283Transition": "0x0", - "eip1283DisableTransition": "1000000" - }, - "genesis": { - "seal": { - "authorityRound": { - "step": "0x0", - "signature": "0x0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001" - } - }, - "difficulty": "0x20000", - "gasLimit": "0x663BE0", - "extraData": "0x781892197f53fe153b9f0991a7c9f80750171cbbf6dde5cce1058832b029dda5" - }, - "accounts": { - "0000000000000000000000000000000000000005": { - "builtin": { - "name": "modexp", - "activate_at": "0x0", - "pricing": { - "modexp": { - "divisor": 20 - } - } - } - }, - "0000000000000000000000000000000000000006": { - "builtin": { - "name": "alt_bn128_add", - "activate_at": "0x0", - "eip1108_transition": "0x7fffffffffffff", - "pricing": { - "alt_bn128_const_operations": { - "price": 500, - "eip1108_transition_price": 150 - } - } - } - }, - "0000000000000000000000000000000000000007": { - "builtin": { - "name": "alt_bn128_mul", - "activate_at": "0x0", - "eip1108_transition": "0x7fffffffffffff", - "pricing": { - "alt_bn128_const_operations": { - "price": 40000, - "eip1108_transition_price": 6000 - } - } - } - }, - "0000000000000000000000000000000000000008": { - "builtin": { - "name": "alt_bn128_pairing", - "activate_at": "0x0", - "eip1108_transition": "0x7fffffffffffff", - "pricing": { - "alt_bn128_pairing": { - "base": 100000, - "pair": 80000, - "eip1108_transition_base": 45000, - "eip1108_transition_pair": 34000 - } - } - } - }, - "0x0000000000000000000000000000000000000001": { - "balance": "1", - "builtin": { - "name": "ecrecover", - "pricing": { - "linear": { - "base": 3000, - "word": 0 - } - } - } - }, - "0x0000000000000000000000000000000000000002": { - "balance": "1", - "builtin": { - "name": "sha256", - "pricing": { - "linear": { - "base": 60, - "word": 12 - } - } - } - }, - "0x0000000000000000000000000000000000000003": { - "balance": "1", - "builtin": { - "name": "ripemd160", - "pricing": { - "linear": { - "base": 600, - "word": 120 - } - } - } - }, - "0x0000000000000000000000000000000000000004": { - "balance": "1", - "builtin": { - "name": "identity", - "pricing": { - "linear": { - "base": 15, - "word": 3 - } - } - } - }, - "0x8e1ca34f5718996f2531464f1323f959d8a8dd21": { - "balance": "300000000000000000000000000" - }, - "0xAAA0000000000000000000000000000000000AAA": { - "balance":"1", - "constructor": "0x608060405260018054600160a060020a031916600260a060020a03179055600a805460a060020a63ffffffff02191690553480156200003d57600080fd5b50604051620017d8380380620017d883398101604090815281516020830151918301519092919091019060008080600160a060020a03861615156200008157600080fd5b60088054600160a060020a031916600160a060020a03881690811790915560078590556040805160208101909152908152620000c29060029060016200026a565b50600092505b84518310156200015e578451600090869085908110620000e457fe5b60209081029091010151600160a060020a031614156200010357600080fd5b600285848151811015156200011457fe5b6020908102919091018101518254600180820185556000948552929093209092018054600160a060020a031916600160a060020a03909316929092179091559290920191620000c8565b600091505b6002548210156200021a5760028054839081106200017d57fe5b600091825260209091200154600160a060020a03169050620001a8816401000000006200024c810204565b15620001b357600080fd5b6040805160608101825260018082526020808301828152838501878152600160a060020a038716600090815260049093529490912092518354915115156101000261ff001991151560ff199093169290921716178255915190820155919091019062000163565b600280546200022c91600391620002d4565b5050600a8054600160a060020a0319163317905550620003419350505050565b600160a060020a031660009081526004602052604090205460ff1690565b828054828255906000526020600020908101928215620002c2579160200282015b82811115620002c25782518254600160a060020a031916600160a060020a039091161782556020909201916001909101906200028b565b50620002d092915062000317565b5090565b828054828255906000526020600020908101928215620002c25760005260206000209182015b82811115620002c2578254825591600101919060010190620002fa565b6200033e91905b80821115620002d0578054600160a060020a03191681556001016200031e565b90565b61148780620003516000396000f3006080604052600436106101695763ffffffff7c010000000000000000000000000000000000000000000000000000000060003504166303aca79281146101ea5780630eaba26a1461021e578063108552691461024557806321a3fb8514610268578063273cb593146102a2578063379fed9a146102b75780634110a489146102cc578063424df9a41461030d57806345199e0a1461032257806375286211146103875780637efe8c1e1461039c578063879736b2146103c65780638c187fdf146103ed5780638f2eabe11461040e578063900eb5a81461042f5780639a573786146104475780639a78538f1461045c578063a5f8b8741461047d578063a875633714610492578063aa67c919146104a7578063ae4b1b5b146104bb578063b3f05b97146104d0578063b7ab4db5146104e5578063d3e848f1146104fa578063ec7de1e91461050f578063f89a77b114610524578063fa81b2001461054a578063facd743b1461055f575b60008034111561018d573360009081526005602052604090208054340190556101e7565b50336000908152600560205260408120549081116101aa57600080fd5b336000818152600560205260408082208290555183156108fc0291849190818181858888f193505050501580156101e5573d6000803e3d6000fd5b505b50005b3480156101f657600080fd5b50610202600435610580565b60408051600160a060020a039092168252519081900360200190f35b34801561022a57600080fd5b506102336105a8565b60408051918252519081900360200190f35b34801561025157600080fd5b50610266600160a060020a03600435166105af565b005b34801561027457600080fd5b5061028e600160a060020a036004351660243515156106e7565b604080519115158252519081900360200190f35b3480156102ae57600080fd5b5061028e610738565b3480156102c357600080fd5b5061028e61075a565b3480156102d857600080fd5b506102ed600160a060020a036004351661077b565b604080519315158452911515602084015282820152519081900360600190f35b34801561031957600080fd5b506102336107a1565b34801561032e57600080fd5b506103376107a7565b60408051602080825283518183015283519192839290830191858101910280838360005b8381101561037357818101518382015260200161035b565b505050509050019250505060405180910390f35b34801561039357600080fd5b50610266610809565b3480156103a857600080fd5b50610266600160a060020a0360043581169060243516604435610a42565b3480156103d257600080fd5b5061028e600160a060020a0360043581169060243516610aea565b3480156103f957600080fd5b50610233600160a060020a0360043516610c21565b34801561041a57600080fd5b5061028e600160a060020a0360043516610c33565b34801561043b57600080fd5b50610202600435610c6a565b34801561045357600080fd5b50610202610c78565b34801561046857600080fd5b50610233600160a060020a0360043516610d16565b34801561048957600080fd5b5061028e610d28565b34801561049e57600080fd5b50610233610d4c565b610266600160a060020a0360043516610d97565b3480156104c757600080fd5b50610202610dd8565b3480156104dc57600080fd5b5061028e610de7565b3480156104f157600080fd5b50610337610e0a565b34801561050657600080fd5b50610202610e6a565b34801561051b57600080fd5b50610202610e79565b34801561053057600080fd5b5061028e600160a060020a03600435166024351515610e88565b34801561055657600080fd5b50610202610ec7565b34801561056b57600080fd5b5061028e600160a060020a0360043516610ed6565b600380548290811061058e57fe5b600091825260209091200154600160a060020a0316905081565b6002545b90565b600854600160a060020a0316331480156105e45750600a5474010000000000000000000000000000000000000000900460ff16155b806105f95750600a54600160a060020a031633145b151561060457600080fd5b600a5477010000000000000000000000000000000000000000000000900460ff161561062f57600080fd5b600160a060020a038116151561064457600080fd5b60008054600160a060020a0380841673ffffffffffffffffffffffffffffffffffffffff199092169190911791829055600a805477ff000000000000000000000000000000000000000000000019167701000000000000000000000000000000000000000000000017905560408051929091168252517f600bcf04a13e752d1e3670a5a9f1c21177ca2a93c6f5391d4f1298d098097c229181900360200190a150565b60006106f1610c78565b600160a060020a0316331461070557600080fd5b61070e83610ef8565b1561072e5761071d8383610f5a565b610726836110c0565b506001610732565b5060005b92915050565b600a547501000000000000000000000000000000000000000000900460ff1690565b600a5474010000000000000000000000000000000000000000900460ff1690565b6004602052600090815260409020805460019091015460ff808316926101009004169083565b60075481565b606060038054806020026020016040519081016040528092919081815260200182805480156107ff57602002820191906000526020600020905b8154600160a060020a031681526001909101906020018083116107e1575b5050505050905090565b6001546000908190600160a060020a0316331480156108455750600a54760100000000000000000000000000000000000000000000900460ff16155b151561085057600080fd5b600a805476ff000000000000000000000000000000000000000000001916760100000000000000000000000000000000000000000000179055600091505b6003548210156108fc57600460006003848154811015156108ab57fe5b6000918252602080832090910154600160a060020a031683528201929092526040019020805490915060ff6101009091041615156108f157805461ff0019166101001781555b60019091019061088e565b6003805461090c91600291611397565b50600954600160a060020a03161561095157600980546008805473ffffffffffffffffffffffffffffffffffffffff19908116600160a060020a038416179091551690555b600a547501000000000000000000000000000000000000000000900460ff16156109c657600a805475ff0000000000000000000000000000000000000000001974ff00000000000000000000000000000000000000001990911674010000000000000000000000000000000000000000171690555b7f8564cd629b15f47dc310d45bcbfc9bcf5420b0d51bf0659a16c67f91d27632536109ef610e0a565b60408051602080825283518183015283519192839290830191858101910280838360005b83811015610a2b578181015183820152602001610a13565b505050509050019250505060405180910390a15050565b610a4a610c78565b600160a060020a03163314610a5e57600080fd5b610a6783610ed6565b1515610a7257600080fd5b600160a060020a038316600090815260066020526040902054811115610a9757600080fd5b600160a060020a0380841660009081526006602052604080822080548590039055519184169183156108fc0291849190818181858888f19350505050158015610ae4573d6000803e3d6000fd5b50505050565b6000610af4610c78565b600160a060020a03163314610b0857600080fd5b610b1182611121565b1580610b235750610b2183610ef8565b155b15610b3057506000610732565b610b3b82600061114c565b610b46836000610f5a565b610b508383611335565b600854600160a060020a0383811691161415610b8f576009805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0385161790555b6001430340600019167f55252fa6eee4741b4e24a74a70e9c11fd2c2281df8d6ea13126ff845f7825c89600360405180806020018281038252838181548152602001915080548015610c0a57602002820191906000526020600020905b8154600160a060020a03168152600190910190602001808311610bec575b50509250505060405180910390a250600192915050565b60066020526000908152604090205481565b600160a060020a03811660009081526004602052604081205460ff80821691610100900416818015610c625750805b949350505050565b600280548290811061058e57fe5b60008060009054906101000a9004600160a060020a0316600160a060020a0316639a5737866040518163ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401602060405180830381600087803b158015610ce557600080fd5b505af1158015610cf9573d6000803e3d6000fd5b505050506040513d6020811015610d0f57600080fd5b5051905090565b60056020526000908152604090205481565b600a5477010000000000000000000000000000000000000000000000900460ff1681565b600a5460009074010000000000000000000000000000000000000000900460ff1615610d7b57506002546105ac565b6002541515610d8c575060006105ac565b506002546000190190565b600160a060020a0381161515610dac57600080fd5b60003411610db957600080fd5b600160a060020a03166000908152600560205260409020805434019055565b600054600160a060020a031681565b600a54760100000000000000000000000000000000000000000000900460ff1681565b606060028054806020026020016040519081016040528092919081815260200182805480156107ff57602002820191906000526020600020908154600160a060020a031681526001909101906020018083116107e1575050505050905090565b600154600160a060020a031681565b600954600160a060020a031690565b6000610e92610c78565b600160a060020a03163314610ea657600080fd5b610eaf83611121565b1561072e57610ebe838361114c565b61072683611366565b600854600160a060020a031690565b600160a060020a03811660009081526004602052604090205460ff165b919050565b6000600160a060020a0382161515610f1257506000610ef3565b610f1b82610ed6565b15610f2857506000610ef3565b600754600160a060020a0383166000908152600560205260409020541015610f5257506000610ef3565b506001919050565b6040805160608101825260018082526000602080840182815260038054868801908152600160a060020a038a16808652600490945296842095518654925115156101000261ff001991151560ff19909416939093171691909117855594519383019390935583549182018455929092527fc2575a0e9e593c00f959f8c92f12db2869c3395a3b0502d05e2516446f71f85b909101805473ffffffffffffffffffffffffffffffffffffffff19169091179055600a805476ff000000000000000000000000000000000000000000001916905580156110bc576001430340600019167f55252fa6eee4741b4e24a74a70e9c11fd2c2281df8d6ea13126ff845f7825c896003604051808060200182810382528381815481526020019150805480156110ad57602002820191906000526020600020905b8154600160a060020a0316815260019091019060200180831161108f575b50509250505060405180910390a25b5050565b600754600160a060020a03821660009081526005602052604090205410156110e457fe5b60078054600160a060020a039092166000908152600560209081526040808320805495909503909455915460069092529190912080549091019055565b600354600090151561113557506000610ef3565b61113e82610ed6565b1515610f5257506000610ef3565b600160a060020a0382166000908152600460205260408120600101546003805491926000198301929091908390811061118157fe5b60009182526020909120015460038054600160a060020a0390921692508291859081106111aa57fe5b6000918252602080832091909101805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a03948516179055918316815260049091526040902060010183905560038054906112069060001983016113e7565b50600160a060020a03851660009081526004602052604081206001810191909155805461ffff19169055600a805476ff0000000000000000000000000000000000000000000019169055831561132e57600854600160a060020a03868116911614156112a457600a805475ff000000000000000000000000000000000000000000191675010000000000000000000000000000000000000000001790555b6001430340600019167f55252fa6eee4741b4e24a74a70e9c11fd2c2281df8d6ea13126ff845f7825c8960036040518080602001828103825283818154815260200191508054801561131f57602002820191906000526020600020905b8154600160a060020a03168152600190910190602001808311611301575b50509250505060405180910390a25b5050505050565b600160a060020a03908116600081815260066020526040808220805495909416825281208054909401909355825255565b600160a060020a03166000908152600660208181526040808420805460058452918520805490920190915591905255565b8280548282559060005260206000209081019282156113d75760005260206000209182015b828111156113d75782548255916001019190600101906113bc565b506113e3929150611410565b5090565b81548183558181111561140b5760008381526020902061140b918101908301611441565b505050565b6105ac91905b808211156113e357805473ffffffffffffffffffffffffffffffffffffffff19168155600101611416565b6105ac91905b808211156113e357600081556001016114475600a165627a7a72305820d27508e24727785062791fb3da3055dc7456eda5214278ecc77692e95c83acec00290000000000000000000000008e1ca34f5718996f2531464f1323f959d8a8dd21000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000003b8e97d229a2d548000000000000000000000000000000000000000000000000000000000000000000000" - } - } -} diff --git a/templates/spec.json b/templates/spec.json deleted file mode 100644 index bf168b6..0000000 --- a/templates/spec.json +++ /dev/null @@ -1,174 +0,0 @@ -{ - "name": "DPoSChain", - "engine": { - "authorityRound": { - "params": { - "stepDuration": 5, - "blockReward": "0x0", - "maximumUncleCountTransition": 0, - "maximumUncleCount": 0, - "validators": { - "multi": { - "0": { - "contract": "0x1000000000000000000000000000000000000001" - } - } - }, - "blockRewardContractAddress": "0x2000000000000000000000000000000000000001", - "blockRewardContractTransition": 0, - "randomnessContractAddress": { - "0": "0x3000000000000000000000000000000000000001" - }, - "twoThirdsMajorityTransition": 1000000, - "posdaoTransition": 0, - "blockGasLimitContractTransitions": { - "0": "0x4000000000000000000000000000000000000001" - } - } - } - }, - "params": { - "gasLimitBoundDivisor": "0x400", - "maximumExtraDataSize": "0x20", - "minGasLimit": "0x1388", - "networkID": "101", - "eip140Transition": "0x0", - "eip211Transition": "0x0", - "eip214Transition": "0x0", - "eip658Transition": "0x0", - "eip145Transition": "0x0", - "eip1014Transition": "0x0", - "eip1052Transition": "0x0", - "eip1283Transition": "0x0", - "eip1344Transition": "0x0", - "eip1706Transition": "0x0", - "eip1884Transition": "0x0", - "eip2028Transition": "0x0", - "registrar": "0x6000000000000000000000000000000000000000", - "transactionPermissionContract": "0x4000000000000000000000000000000000000001", - "transactionPermissionContractTransition": "0x0" - }, - "genesis": { - "seal": { - "authorityRound": { - "step": "0x0", - "signature": "0x0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000" - } - }, - "difficulty": "0x20000", - "gasLimit": "0x989680" - }, - "accounts": { - "0000000000000000000000000000000000000005": { - "builtin": { - "name": "modexp", - "activate_at": "0x0", - "pricing": { - "modexp": { - "divisor": 20 - } - } - } - }, - "0000000000000000000000000000000000000006": { - "builtin": { - "name": "alt_bn128_add", - "activate_at": "0x0", - "eip1108_transition": "0x0", - "pricing": { - "alt_bn128_const_operations": { - "price": 500, - "eip1108_transition_price": 150 - } - } - } - }, - "0000000000000000000000000000000000000007": { - "builtin": { - "name": "alt_bn128_mul", - "activate_at": "0x0", - "eip1108_transition": "0x0", - "pricing": { - "alt_bn128_const_operations": { - "price": 40000, - "eip1108_transition_price": 6000 - } - } - } - }, - "0000000000000000000000000000000000000008": { - "builtin": { - "name": "alt_bn128_pairing", - "activate_at": "0x0", - "eip1108_transition": "0x0", - "pricing": { - "alt_bn128_pairing": { - "base": 100000, - "pair": 80000, - "eip1108_transition_base": 45000, - "eip1108_transition_pair": 34000 - } - } - } - }, - "0x0000000000000000000000000000000000000009": { - "builtin": { - "name": "blake2_f", - "activate_at": "0x0", - "pricing": { - "blake2_f": { - "gas_per_round": 1 - } - } - } - }, - "0x0000000000000000000000000000000000000001": { - "balance": "1", - "builtin": { - "name": "ecrecover", - "pricing": { - "linear": { - "base": 3000, - "word": 0 - } - } - } - }, - "0x0000000000000000000000000000000000000002": { - "balance": "1", - "builtin": { - "name": "sha256", - "pricing": { - "linear": { - "base": 60, - "word": 12 - } - } - } - }, - "0x0000000000000000000000000000000000000003": { - "balance": "1", - "builtin": { - "name": "ripemd160", - "pricing": { - "linear": { - "base": 600, - "word": 120 - } - } - } - }, - "0x0000000000000000000000000000000000000004": { - "balance": "1", - "builtin": { - "name": "identity", - "pricing": { - "linear": { - "base": 15, - "word": 3 - } - } - } - } - } -} From fb6424fc7348bbd78a660f42b11674730f83e81f Mon Sep 17 00:00:00 2001 From: MSalman6 Date: Tue, 26 Nov 2024 20:56:31 +0500 Subject: [PATCH 3/3] made _poolNodeOperatorLastChangeEpoch public --- contracts/StakingHbbft.sol | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/contracts/StakingHbbft.sol b/contracts/StakingHbbft.sol index cf17a1e..5c83e49 100644 --- a/contracts/StakingHbbft.sol +++ b/contracts/StakingHbbft.sol @@ -148,7 +148,7 @@ contract StakingHbbft is Initializable, OwnableUpgradeable, ReentrancyGuardUpgra mapping(address => uint256) public poolNodeOperatorShare; /// @dev The epoch number in which the operator's address can be changed. - mapping(address => uint256) internal _poolNodeOperatorLastChangeEpoch; + mapping(address => uint256) public poolNodeOperatorLastChangeEpoch; // ============================================== Constants ======================================================= @@ -1491,7 +1491,7 @@ contract StakingHbbft is Initializable, OwnableUpgradeable, ReentrancyGuardUpgra revert InvalidNodeOperatorConfiguration(_operatorAddress, _operatorSharePercent); } - uint256 lastChangeEpoch = _poolNodeOperatorLastChangeEpoch[_stakingAddress]; + uint256 lastChangeEpoch = poolNodeOperatorLastChangeEpoch[_stakingAddress]; if (lastChangeEpoch != 0 && lastChangeEpoch == stakingEpoch) { revert OnlyOncePerEpoch(stakingEpoch); } @@ -1499,7 +1499,7 @@ contract StakingHbbft is Initializable, OwnableUpgradeable, ReentrancyGuardUpgra poolNodeOperator[_stakingAddress] = _operatorAddress; poolNodeOperatorShare[_stakingAddress] = _operatorSharePercent; - _poolNodeOperatorLastChangeEpoch[_stakingAddress] = stakingEpoch; + poolNodeOperatorLastChangeEpoch[_stakingAddress] = stakingEpoch; emit SetNodeOperator(_stakingAddress, _operatorAddress, _operatorSharePercent); }