Transition from buidler to hardhat
This commit is contained in:
@ -12,7 +12,7 @@ const BadBeaconNoImpl = artifacts.require('BadBeaconNoImpl');
|
||||
const BadBeaconNotContract = artifacts.require('BadBeaconNotContract');
|
||||
|
||||
function toChecksumAddress (address) {
|
||||
return ethereumjsUtil.toChecksumAddress('0x' + address.replace(/^0x/, '').padStart(40, '0'));
|
||||
return ethereumjsUtil.toChecksumAddress('0x' + address.replace(/^0x/, '').padStart(40, '0').substr(-40));
|
||||
}
|
||||
|
||||
const BEACON_LABEL = 'eip1967.proxy.beacon';
|
||||
|
||||
@ -20,7 +20,7 @@ const IMPLEMENTATION_LABEL = 'eip1967.proxy.implementation';
|
||||
const ADMIN_LABEL = 'eip1967.proxy.admin';
|
||||
|
||||
function toChecksumAddress (address) {
|
||||
return ethereumjsUtil.toChecksumAddress('0x' + address.replace(/^0x/, '').padStart(40, '0'));
|
||||
return ethereumjsUtil.toChecksumAddress('0x' + address.replace(/^0x/, '').padStart(40, '0').substr(-40));
|
||||
}
|
||||
|
||||
module.exports = function shouldBehaveLikeTransparentUpgradeableProxy (createProxy, accounts) {
|
||||
|
||||
@ -5,6 +5,10 @@ const { expect } = require('chai');
|
||||
|
||||
const DummyImplementation = artifacts.require('DummyImplementation');
|
||||
|
||||
function toChecksumAddress (address) {
|
||||
return ethereumjsUtil.toChecksumAddress('0x' + address.replace(/^0x/, '').padStart(40, '0').substr(-40));
|
||||
}
|
||||
|
||||
const IMPLEMENTATION_LABEL = 'eip1967.proxy.implementation';
|
||||
|
||||
function toChecksumAddress (address) {
|
||||
@ -29,7 +33,7 @@ module.exports = function shouldBehaveLikeUpgradeableProxy (createProxy, proxyAd
|
||||
const assertProxyInitialization = function ({ value, balance }) {
|
||||
it('sets the implementation address', async function () {
|
||||
const slot = '0x' + new BN(ethereumjsUtil.keccak256(Buffer.from(IMPLEMENTATION_LABEL))).subn(1).toString(16);
|
||||
const implementation = toChecksumAddress(await web3.eth.getStorageAt(this.proxy, slot));
|
||||
const implementation = toChecksumAddress((await web3.eth.getStorageAt(this.proxy, slot)).substr(-40));
|
||||
expect(implementation).to.be.equal(this.implementation);
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user