https://community.cisco.com/t5/routing/acl-to-allow-snmp-traffic/td-p/1577251
ip access-list extended ABC-ACL
permit udp X.X.0.0 0.0.255.255 eq snmp host SERVER_IP
permit udp X.X.0.0 0.0.255.255 host SERVER_IP eq snmptrap
snmptraps are sent to the server on port 162 so that line is correct. But the snmp line was wrong because the SNMP request is sent from the manager to destination port 161 on the x.x.0.0 device. Note that the source port is a random port.
When the device responds it sends the snmp response back to server. The destination port is the random port and source port is 161 so your original acl was wrong.