Skip to content

Commit

Permalink
change visibility
Browse files Browse the repository at this point in the history
  • Loading branch information
adraffy committed Jan 8, 2024
1 parent bbd6db3 commit b1d0e6a
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/Punycode.sol
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ library Punycode {
if (src == dst) return puny; // unchanged
assembly { uni := sub(dst, 32) }
}
function encode(string memory uni) external pure returns (string memory puny) {
function encode(string memory uni) internal pure returns (string memory puny) {
uint256 src;
uint256 len;
assembly {
Expand Down
3 changes: 2 additions & 1 deletion test/demo.html
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ <h1>Punycode Decoder</h1>

let contract = new ethers.Contract('0xBEfeca057ea022e7aB419670a659d32f125973C1', [
`function decode(string memory s) external pure returns (string memory)`,
`function encode(string memory s) external pure returns (string memory)`
`function encode(string memory s) external pure returns (string memory)`,
], provider);

for (let btn of document.querySelectorAll('#examples button')) {
Expand Down Expand Up @@ -191,6 +191,7 @@ <h1>Punycode Decoder</h1>
`;
output.querySelector('input').value = decoded;
} catch (err) {
console.log(err);
let error;
if (err.code === 'CALL_EXCEPTION') {
error = `<b>Punycode Error</b>: ${err.reason}`;
Expand Down

0 comments on commit b1d0e6a

Please sign in to comment.