alastria / alastriaID-hardhat-contracts

Alastria ID contract in hardhat framework
MIT License
0 stars 1 forks source link

Fix CreateAlastriaID function in AlastriaIdentityManager.sol #6

Closed rober12 closed 2 weeks ago

rober12 commented 5 months ago

It has been detected that the CreateAlastriaID function should receive as parameter a bytes32, referring to the hash of the public key, since the addPublicKey function of the smart contract PublicKeyRegistry now receives as parameter a bytes32 and not a string.

SMART CONTRACT FUNCTION OF THE IDENTITY MANAGER CALLING THE PUBLIC KEY REGISTRY FUNCTION

/**
    * @dev Creates a new AlastriaProxy contract for an owner and recovery and allows an initial forward call which would be to set the registry in our case
    * @param publicKey to be encoded in PublicKeyRegistry call from IdentityManager
    */
    function createAlastriaIdentity(string memory publicKey, uint256 format) public validAddress(msg.sender) isPendingAndOnTime(msg.sender) {
        AlastriaProxy identity = new AlastriaProxy();
        identityKeys[msg.sender] = address(identity);
        pendingIDs[msg.sender] = 0;
        bytes memory addPublicKeyCallData = abi.encodeWithSignature("addPublicKey(string, uin256)", publicKey, format);
        identity.forward(address(alastriaPublicKeyRegistry), 0, addPublicKeyCallData);//must be alastria registry call
    }

SMART CONTRACT FUNCTION OF THE PUBLIC KEY REGISTRY

    function addPublicKey(bytes32 publicKeyHash) public {
        require(!publicKeyRegistry[msg.sender][publicKeyHash].exists);
        uint changeDate = block.timestamp;
        publicKeyRegistry[msg.sender][publicKeyHash] = PublicKey(
            true, 
            Status.Valid,
            changeDate,
            0
        );
    }

The changes that would need to be made would be:

alejandroalffer commented 5 months ago

@Fcocard , please take a look at this Issue: we'll update the SmartContract in order to release v2.2 of AlastriaID

We need to redeploy this SmartContract to alastriaT and alastriaB through the DigitelTS node, and finalize this Issue: https://github.com/alastria/alastria- identity-lib/issues/178

More detail in https://alastria.atlassian.net/wiki/spaces/ALASTRIAID/pages/678690817/12+04+2024+-+Meeting+Notes+Libs notes

Fcocard commented 4 months ago

The smart contracts with the new changes have been deployed. They are at: _redB_addresses.json _redT_addresses.json